Skip to content

Commit

Permalink
feat: centralize background image handling and clean up assets
Browse files Browse the repository at this point in the history
  • Loading branch information
BigBen-7 committed Dec 20, 2024
1 parent a1eebe4 commit 1a4cc2e
Show file tree
Hide file tree
Showing 14 changed files with 25 additions and 27 deletions.
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"cSpell.words": ["Spotnet"]
}
File renamed without changes
File renamed without changes
12 changes: 5 additions & 7 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ 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 [currentPage, setCurrentPage] = useState('home');
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 +53,6 @@ function App() {
setShowModal(false);
};


const handleisMobileRestrictionModalClose = () => {
setisMobileRestrictionModalOpen(false);
};
Expand All @@ -71,15 +70,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 +126,4 @@ function App() {
);
}

export default App;
export default App;
9 changes: 9 additions & 0 deletions frontend/src/globals.css
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
6 changes: 3 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,17 @@ 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 () => {
console.log('Launch button clicked'); // Debugging
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

0 comments on commit 1a4cc2e

Please sign in to comment.