Skip to content

Commit

Permalink
Added required connect wallet message on homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
SunDr17 committed Jan 28, 2024
1 parent 33804b3 commit d03279c
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 24 deletions.
1 change: 1 addition & 0 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
"user_current_percent": "Current profit percent",
"completeCountdownText": "You won't get a profit until you feed the pets",
"homepage": {
"wallet_not_connected": "Please connect wallet to start your journey",
"timer": "Until next feed",
"finish_cycle_button": "Feed",
"user_current_profit": "Current profit",
Expand Down
1 change: 1 addition & 0 deletions public/locales/ru/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
"user_current_percent": "Текущий процент",
"completeCountdownText": "Вы не будете получать профит, пока не покормите питомцев",
"homepage": {
"wallet_not_connected": "Пожалуйста, подключите кошелек для покупки вашего питомца",
"timer": "До следующего кормления",
"finish_cycle_button": "Кормить",
"user_current_profit": "Текущий профит",
Expand Down
54 changes: 30 additions & 24 deletions src/components/pages/Home/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,42 +5,48 @@ import { LinkContainer } from 'react-router-bootstrap';
import Container from 'react-bootstrap/Container';
import { Col, Row } from 'react-bootstrap';
import Button from 'react-bootstrap/Button';
import { useAccount } from 'wagmi';

import { getBoughtData } from '@/services/data/items';
import ItemsGrid from '@/components/common/ItemsGrid';
import TokenomicInfo from '@/components/pages/Home/TokenomicInfo';

export default function Home() {
const { t } = useTranslation();
const { isConnected: isWalletConnected } = useAccount();
const boughtItems = getBoughtData();

return (
<Container fluid>
<Row>
<Col sm="4">
<TokenomicInfo />
</Col>
<Col>
<ItemsGrid
items={boughtItems}
emptyPlaceholder={(
<div>
<p>{t('homepage.grid.empty.header')}</p>
<p>
<Trans
i18nKey="homepage.grid.empty.body"
components={{
tokenomicLink: <Link to="tokenomics" />,
}}
/>
</p>
<LinkContainer to="/shop">
<Button>{t('homepage.grid.empty.button')}</Button>
</LinkContainer>
</div>
)}
/>
</Col>
{isWalletConnected ? (
<>
<Col sm="4">
<TokenomicInfo />
</Col>
<Col>
<ItemsGrid
items={boughtItems}
emptyPlaceholder={(
<div>
<p>{t('homepage.grid.empty.header')}</p>
<p>
<Trans
i18nKey="homepage.grid.empty.body"
components={{
tokenomicLink: <Link to="tokenomics" />,
}}
/>
</p>
<LinkContainer to="/shop">
<Button>{t('homepage.grid.empty.button')}</Button>
</LinkContainer>
</div>
)}
/>
</Col>
</>
) : <p className="display-8">{t('homepage.wallet_not_connected')}</p>}
</Row>
</Container>
);
Expand Down
10 changes: 10 additions & 0 deletions src/styles/theme.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,13 @@

// Import Bootstrap and its default variables
@import 'bootstrap';
@import 'bootstrap/scss/mixins';
@import 'bootstrap/scss/variables';

.display-7 {
@include font-size(2rem);
}

.display-8 {
@include font-size(1.5rem);
}

0 comments on commit d03279c

Please sign in to comment.