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

UX improvements for sessions and GDPR page #102

Merged
merged 2 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const Content: React.FC = () => {
<Route element={<BaseElement />}>
{/* Public routes */}
<Route element={<FrontPage />}>
<Route path="/" element={<Login />} />
<Route path="login" element={<Login />} />
<Route path="register" element={<Register />} />
<Route
path={'request-password-reset'}
Expand Down Expand Up @@ -86,7 +86,7 @@ const Content: React.FC = () => {
</Route>

{/* 404 */}
<Route path="*" element={<Navigate to="/" />} />
<Route path="*" element={<Navigate to="/logbook" />} />
</Route>
</Routes>
</main>
Expand Down
13 changes: 8 additions & 5 deletions src/components/Footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,17 @@ import React from 'react';
import styles from './Footer.module.scss';
import Tayttopaikka from '../../svg/tayttopaikka.svg?react';
import happihakkiInstructions from '../../Files/happihakki-instructions.pdf';
import { Link } from 'react-router-dom';

export const Footer: React.FC = () => {
return (
<div className={styles.footer}>
<div className={styles.row}>
<div className={styles.logo}>
<Tayttopaikka />
</div>
<Link to="/logbook">
<div className={styles.logo}>
<Tayttopaikka />
</div>
</Link>
</div>
<div className={styles.row}>
<a href="https://taursu.fi" className={styles.item}>
Expand All @@ -20,9 +23,9 @@ export const Footer: React.FC = () => {
</a>
</div>
<div className={styles.row}>
<a href="/gdpr" className={styles.item}>
<Link to="/gdpr" className={styles.item}>
Tietosuojaseloste
</a>
</Link>
<a href={happihakkiInstructions} download className={styles.item}>
Happihäkin ohjeet
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const Navbar: React.FC = () => {
// Invalidate React Query cache
queryClient.clear();

navigate('/');
navigate('/login');
}, [navigate, queryClient]);

const { isAdmin, isBlender } = getUserRoles();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const PasswordResetRequestForm: React.FC = () => {
const navigate = useNavigate();

const handleSuccessfulPasswordResetRequest = useCallback(() => {
navigate('/');
navigate('/login');
}, [navigate]);

const { mutate } = usePasswordResetRequestMutation(
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/Auth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ export const ProtectedRoute: React.FC<PrivateRouteProps> = ({
}
})
.catch(() => {
navigate('/');
navigate('/login');
});
}, [navigate, blenderOnly, adminOnly]);

useEffect(() => {
if (!loading && !authenticated) {
navigate('/');
navigate('/login');
}
}, [authenticated, loading, navigate]);

Expand Down
2 changes: 1 addition & 1 deletion src/lib/queries/registerMutation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const useRegisterMutation = (): UseMutation<
},
onSuccess: () => {
toast.success('Rekistöröityminen onnistui! Kirjaudu sisään.');
navigate('/');
navigate('/login');
},
});

Expand Down
4 changes: 2 additions & 2 deletions src/views/FrontPage/FrontPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ export const FrontPage: React.FC = () => {
const [showBackButton, setShowBackButton] = useState(false);
const location = useLocation();
useEffect(() => {
setShowBackButton(location.pathname !== '/');
setShowBackButton(location.pathname !== '/login');
}, [location]);

return (
<Container className="pt-4">
<div className={styles.content}>
<div className={styles.contentPart}>
{showBackButton && (
<Link className={styles.styledLink} to={'/'}>
<Link className={styles.styledLink} to={'/login'}>
<BsArrowLeftCircle />
</Link>
)}
Expand Down
2 changes: 1 addition & 1 deletion src/views/GDPR.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';

export const GDPR: React.FC = () => {
return (
<div>
<div className="p-4">
<h1>Rekisteri- ja tietosuojaseloste</h1>
<h2>
Tämä on Tampereen Urheilusukeltajat ry:n (Taursu) EU:n yleisen
Expand Down
Loading