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

Merged
merged 10 commits into from
Dec 22, 2024
Binary file removed frontend/public/Form-bg.png
Binary file not shown.
Binary file removed frontend/public/Windowbackground Vault.png
Binary file not shown.
Binary file removed frontend/public/mobilebackground.png
Binary file not shown.
10 changes: 4 additions & 6 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function App() {
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 @@ -52,7 +52,6 @@ function App() {
setShowModal(false);
};


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

export default App;
export default App;
5 changes: 2 additions & 3 deletions frontend/src/components/home/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 '../../layout/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/components/home/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
2 changes: 1 addition & 1 deletion frontend/src/components/ui/Button/index.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export {default as Button} from './Button';
export { default as Button } from './Button';
1 change: 0 additions & 1 deletion frontend/src/components/ui/button/index.js

This file was deleted.

22 changes: 19 additions & 3 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 @@ -67,9 +67,9 @@
--light-dark-background: #130713;
--text-gray: #798795;
--modal-border: #170f2e;
--warning-colour:#BDC000;
--warning-colour-alt: #272A0A;
--warning-text-colour: #F0F0F0;
--warning-colour: #bdc000;
--warning-colour-alt: #272a0a;
--warning-text-colour: #f0f0f0;
}

body {
Expand Down Expand Up @@ -98,3 +98,19 @@ 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;
}

@media (max-width: 550px) {
.App {
background: url('../public/mobile-background.png') no-repeat;
background-size: cover;
background-position: 50% 40%;
height: 100%;
}
}
6 changes: 0 additions & 6 deletions frontend/src/pages/dashboard/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ body {

.dashboard-wrapper {
position: relative;
background: url('../../../public/Form-bg.png') no-repeat;
background-size: cover;
background-position: center left;
min-height: 100vh;
display: flex;
justify-content: center;
Expand Down Expand Up @@ -342,9 +339,6 @@ body {

@media (max-width: 550px) {
.dashboard-wrapper {
background: url('../../../public/dashboardmobile.png') no-repeat;
background-size: cover;
background-position: 50% 40%;
height: 100%;
}
.dashboard-title {
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/pages/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
3 changes: 0 additions & 3 deletions frontend/src/pages/form/form.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
.form-content-wrapper {
background: url('/public/background.png') no-repeat;
background-size: cover;
background-position: center 50%;
display: flex;
flex-direction: column;
gap: 30px;
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/pages/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
2 changes: 0 additions & 2 deletions frontend/src/pages/position-history/positionHistory.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
.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
Loading
Loading