Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: centralize background image handling and clean up assets #420

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
11 changes: 4 additions & 7 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,13 @@ import { TELEGRAM_BOT_LINK } from 'utils/constants';
import { useCheckMobile } from 'hooks/useCheckMobile';
import PositionHistory from 'pages/spotnet/position_history/PositionHistory';


function App() {
const { walletId, setWalletId, removeWalletId } = useWalletStore();
const [showModal, setShowModal] = useState(false);
const navigate = useNavigate();
const [isMobileRestrictionModalOpen, setisMobileRestrictionModalOpen] = useState(true);
const isMobile = useCheckMobile();

const disableDesktopOnMobile = process.env.REACT_APP_DISABLE_DESKTOP_ON_MOBILE !== 'false';

const connectWalletMutation = useConnectWallet(setWalletId);
Expand All @@ -53,7 +52,6 @@ function App() {
setShowModal(false);
};


const handleisMobileRestrictionModalClose = () => {
setisMobileRestrictionModalOpen(false);
};
Expand All @@ -71,15 +69,14 @@ function App() {
})
.catch((error) => {
console.error('Error getting Telegram user wallet ID:', error);
notify('Error loading wallet', "error");
notify('Error loading wallet', 'error');
window.Telegram.WebApp.ready();
});
}
}, [window.Telegram?.WebApp?.initDataUnsafe]);


return (
<div className="App">
<div className={`${location.pathname === '/' ? 'home' : 'App'}`}>
<Notifier />
{showModal &&
createPortal(
Expand Down Expand Up @@ -128,4 +125,4 @@ function App() {
);
}

export default App;
export default App;
9 changes: 9 additions & 0 deletions frontend/src/globals.css
BigBen-7 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,12 @@ li {
a.svelte-1mtuslq.svelte-1mtuslq {
display: none;
}

.App {
background: url('../public/desktop-background.png') no-repeat;
background-size: cover;
min-height: 100vh;
box-sizing: border-box;
}


2 changes: 1 addition & 1 deletion frontend/src/pages/forms/form.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.form-content-wrapper {
background: url('/public/background.png') no-repeat;
background: url('/public/desktop-background.png') no-repeat;
background-size: cover;
background-position: center 50%;
display: flex;
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/pages/spotnet/dashboard/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ body {
Roboto,
Helvetica,
sans-serif;

}

.dashboard-wrapper {
Expand Down Expand Up @@ -342,7 +343,7 @@ body {

@media (max-width: 550px) {
.dashboard-wrapper {
background: url('../../../../public/dashboardmobile.png') no-repeat;
background: url('../../../../public/mobile-background.png') no-repeat;
background-size: cover;
background-position: 50% 40%;
height: 100%;
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/pages/spotnet/documentation/documentation.css
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
.main-content {
margin-left: 370px;
flex: 1;
background: url('../../../../public/background.png') no-repeat;
background-size: cover;
background-position: center 39%;
position: relative;
min-height: 100vh;
}
Expand Down
5 changes: 2 additions & 3 deletions frontend/src/pages/spotnet/home/Home.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@ import './home.css';
import { useWalletStore } from 'stores/useWalletStore';
import { notify } from 'components/Notifier/Notifier';


function Home() {
const { walletId } = useWalletStore();
const { walletId } = useWalletStore();

const navigate = useNavigate();

const handleLaunchApp = async () => {
if (walletId) {
navigate('/form');
} else {
notify('Please connect to your wallet', "warning");
notify('Please connect to your wallet', 'warning');
}
};

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/spotnet/home/home.css
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ body {
text-align: center;
margin-top: 10px;
width: 100%;
pointer-events: none;
pointer-events: auto;
}

.center-text-container {
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/pages/spotnet/overview/overview.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
.overview-container {
background: url('../../../../public/background.png') no-repeat;
background-size: cover;
background-position: center 39%;
min-height: 100vh;
min-width: 100vw;
max-width: 1440px;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
.position-wrapper {
background: url('../../../../public/background.png') no-repeat center center;
background-size: cover;
min-height: 100vh;
padding: 1rem;
box-sizing: border-box;
}

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/vault/stake/stake.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.stake-wrapper {
background: url('../../../../public/background.png') no-repeat;
background: url('../../../../public/desktop-background.png') no-repeat;
background-size: cover;
margin-left:200px;
}
Expand Down
4 changes: 0 additions & 4 deletions frontend/src/pages/vault/withdraw/withdraw.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ body {
sans-serif;
}
.withdraw-wrapper {
background: url('../../../../public/background.png') no-repeat;
background-size: cover;
background-position: center 39%;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: flex-start;
Expand Down
Loading