Skip to content

Commit

Permalink
update: Fri 09 Aug 2024 08:30:05 CEST
Browse files Browse the repository at this point in the history
  • Loading branch information
cophilot committed Aug 9, 2024
1 parent 055cee0 commit db93a32
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/Routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ExpandableTable from './views/ExpandableTable';
import { getAllGames } from './allGames';
import StringUtils from './utils/StringUtils';
import CreateCustomView from './views/CreateCustomView/CreateCustomView';
import PrivacyView from './views/PrivacyView';

function Routes() {
const games = getAllGames();
Expand All @@ -25,6 +26,7 @@ function Routes() {
/>
))}
<Route path="/custom/create" Component={CreateCustomView} />
<Route path="/privacy" Component={PrivacyView} />
<Route path="/" Component={HomeView} />
<Route path="*" Component={HomeView} />
</ReactRoutes>
Expand Down
2 changes: 2 additions & 0 deletions src/components/HomeButton/HomeButton.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.home-button {
}
17 changes: 17 additions & 0 deletions src/components/HomeButton/HomeButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import RouteButton from '../RouteButton/RouteButton';
import './HomeButton.scss';

/**
* This is a HomeButton component
* @author cophilot
* @version 1.0.0
* @created 2024-8-9
*/
function HomeButton() {
return (
<RouteButton to="/" small>
Home
</RouteButton>
);
}
export default HomeButton;
2 changes: 2 additions & 0 deletions src/components/RouteButton/RouteButton.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.route-button {
}
31 changes: 31 additions & 0 deletions src/components/RouteButton/RouteButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { useNavigate } from 'react-router-dom';
import './RouteButton.scss';

interface RouteButtonProps {
to: string;
children: string;
small?: boolean;
}

/**
* This is a RouteButton component
* @author cophilot
* @version 1.0.0
* @created 2024-8-9
*/
function RouteButton({ to, children, small = false }: RouteButtonProps) {
const navigate = useNavigate();

const className = 'btn selected ' + (small ? '' : 'wide');

return (
<button
className={className}
onClick={() => {
navigate(to);
}}>
{children}
</button>
);
}
export default RouteButton;
14 changes: 14 additions & 0 deletions src/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ a {
color: var(--primary-color);
}

p {
font-size: 20px;
}

.btn {
cursor: pointer;
margin: 10px;
Expand Down Expand Up @@ -139,3 +143,13 @@ a {
margin: 10px;
cursor: pointer;
}

.content {
max-width: 600px;
}

@media screen and (max-width: 600px) {
.content {
max-width: 95%;
}
}
9 changes: 6 additions & 3 deletions src/views/HomeView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Logo from '../components/Logo';
import DevMessage from '../components/DevMessage';
import GameButton from '../components/GameButton/GameButton';
import FavoriteGameSection from '../components/FavoriteGameSection/FavoriteGameSection';
import RouteButton from '../components/RouteButton/RouteButton';

export default function HomeView() {
const navigate = useNavigate();
Expand Down Expand Up @@ -66,9 +67,11 @@ export default function HomeView() {
className="btn selected wide"
onClick={() => {
navigate('/custom/create');
}}>
Create <i className="bi bi-plus-circle"></i>
</button> */}
}}>
Create <i className="bi bi-plus-circle"></i>
</button> */}
<h2>Other</h2>
<RouteButton to="privacy">Privacy</RouteButton>
<By />
</div>
);
Expand Down
34 changes: 34 additions & 0 deletions src/views/PrivacyView.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { useEffect } from 'react';
import StyleUtils from '../api/utils/StyleUtils';
import HomeButton from '../components/HomeButton/HomeButton';
import Logo from '../components/Logo';

/**
* This is the PrivacyView
* @author cophilot
* @version 1.0.0
* @created 2024-8-9
*/
function PrivacyView() {
useEffect(() => {
StyleUtils.setDefaultValues();
document.title = 'BoardScoreHub';
}, []);
return (
<div className="content">
<Logo />
<h1>BoardScoreHub Privacy</h1>
<p>
Only data is <b>only</b> kept in your browser. No data will be
sent to any server. This garantuees your privacy, but also means
that you cannot access your data from another device. This also
does not garantuee the persistence of your data. If you clear
your browser data, your data will be lost without any way to
recover it.
</p>
<HomeButton />
</div>
);
}

export default PrivacyView;

0 comments on commit db93a32

Please sign in to comment.