Skip to content

Commit

Permalink
Merge pull request #4 from SunDr17/theming
Browse files Browse the repository at this point in the history
Add footer and theming functionality
  • Loading branch information
SunDr17 authored Jan 23, 2024
2 parents 4d028f4 + 3692282 commit 6f6b110
Show file tree
Hide file tree
Showing 24 changed files with 139 additions and 65 deletions.
22 changes: 22 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"react-router-bootstrap": "^0.26.2",
"react-scripts": "5.0.1",
"react-svg": "^16.1.32",
"sass": "^1.70.0",
"viem": "^2.4.0",
"wagmi": "^2.3.1",
"web-vitals": "^2.1.4"
Expand Down
Binary file modified public/favicon.ico
Binary file not shown.
3 changes: 3 additions & 0 deletions public/images/icons/github.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/images/icons/telegram.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/images/icons/twitter-x.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions public/images/icons/whitepaper.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
content="PetsROI P2E Game"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
<!--
Expand All @@ -24,7 +24,7 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
<title>PetsROI</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
Expand Down
Binary file modified public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"short_name": "React App",
"name": "Create React App Sample",
"short_name": "PetsROI",
"name": "PetsROI P2E Game",
"icons": [
{
"src": "favicon.ico",
Expand Down
9 changes: 0 additions & 9 deletions src/App.test.tsx

This file was deleted.

4 changes: 3 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ import React from 'react';
import Header from '@/components/common/Header';
import Modal from '@/components/common/Modal';
import Routes from '@/routes/Routes';
import Footer from '@/components/common/Footer';

function App() {
return (
<div className="App">
<div className="App d-flex flex-column min-vh-100">
<Header />
<div className="main p-4">
<Routes />
</div>
<Footer />
<Modal />
</div>
);
Expand Down
38 changes: 38 additions & 0 deletions src/components/common/Footer/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import React from 'react';
import { useTranslation } from 'react-i18next';
import Navbar from 'react-bootstrap/Navbar';
import Nav from 'react-bootstrap/Nav';
import Container from 'react-bootstrap/Container';
import { LinkContainer } from 'react-router-bootstrap';

import config from '@/config';
import Icon from '@/components/common/Icon';

export default function Footer() {
const { t } = useTranslation();

return (
<footer className="border-top mt-auto">
<Navbar>
<Container>
<Nav className="m-auto flex-wrap">
<LinkContainer to="/">
<Nav.Link>{t('inventory')}</Nav.Link>
</LinkContainer>
<LinkContainer to="/shop">
<Nav.Link>{t('header.shop')}</Nav.Link>
</LinkContainer>
<LinkContainer to="/ref_program">
<Nav.Link>{t('ref_program')}</Nav.Link>
</LinkContainer>
</Nav>
<Nav>
{Object.keys(config.socialLinks).map((social) => (
<Nav.Link href={config.socialLinks[social]} target="_blank"><Icon name={social} /></Nav.Link>
))}
</Nav>
</Container>
</Navbar>
</footer>
);
}
3 changes: 0 additions & 3 deletions src/components/common/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ export default function Header() {
<LinkContainer to="/shop">
<Nav.Link>{t('header.shop')}</Nav.Link>
</LinkContainer>
<LinkContainer to="/ref_program">
<Nav.Link>{t('ref_program')}</Nav.Link>
</LinkContainer>
</Nav>
<Nav>
<ConnectWallet />
Expand Down
17 changes: 17 additions & 0 deletions src/components/common/Icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React, { memo } from 'react';

type Props = {
className?: string;
name?: string;
url?: string;
};

function Icon({ className = 'icon', name, url }: Props) {
return (name || url) ? (
<i className={className}>
<img alt="icon" src={name ? process.env.PUBLIC_URL + `/images/icons/${name}.svg` : url}></img>
</i>
) : null;
}

export default memo(Icon);
2 changes: 0 additions & 2 deletions src/components/common/MiniCard/MiniCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ export default function MiniCard({ item }: { item: Item }) {
? <FilledSvg
src={item.imageSrc}
color={item.color || item.defaultColor}
height={100}
width={100}
/>
: <Card.Img
bsPrefix="card-img-top pt-2"
variant="top"
src={item.imageSrc}
width={100}
height={100}
/>
}
</div>
Expand Down
6 changes: 6 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,10 @@ export default {
150000: 3,
} as { [index: string]: number },
cycleDuration: 24 * 60 * 60 * 1000,
socialLinks: {
'twitter-x': 'https://twitter.com/',
telegram: 'https://t.me/CrypTime_Channel',
github: 'https://github.com',
whitepaper: 'https://ethereum.org/en/whitepaper',
} as { [index: string]: string },
};
13 changes: 0 additions & 13 deletions src/index.css

This file was deleted.

17 changes: 5 additions & 12 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,12 @@ import { Provider } from 'react-redux';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { WagmiProvider } from 'wagmi';

import App from './App';
import reportWebVitals from './reportWebVitals';
import store from './store/index';
import './services/i18n';
import { wagmiConfig } from './services/web3/wagmiConfig';
import App from '@/App';
import store from '@/store/index';
import '@/services/i18n';
import { wagmiConfig } from '@/services/web3/wagmiConfig';

import 'bootstrap/dist/css/bootstrap.min.css';
import './index.css';
import '@/styles/theme.scss';

const queryClient = new QueryClient();

Expand All @@ -32,8 +30,3 @@ root.render(
</Provider>
</React.StrictMode>
);

// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
1 change: 0 additions & 1 deletion src/logo.svg

This file was deleted.

15 changes: 0 additions & 15 deletions src/reportWebVitals.ts

This file was deleted.

5 changes: 0 additions & 5 deletions src/setupTests.ts

This file was deleted.

5 changes: 5 additions & 0 deletions src/styles/theme.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Override default variables before the import
// https://getbootstrap.com/docs/5.3/customize/sass/#variable-defaults

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

0 comments on commit 6f6b110

Please sign in to comment.