Skip to content

Commit

Permalink
Add dark-friendly default avatar and custom 404 image
Browse files Browse the repository at this point in the history
  • Loading branch information
js0mmer committed Jan 28, 2024
1 parent 04dcde5 commit bc8666d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 3 deletions.
Binary file removed site/public/working.gif
Binary file not shown.
Binary file added site/src/asset/default-avatar-dark.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 added site/src/asset/no-results-crop.webp
Binary file not shown.
3 changes: 2 additions & 1 deletion site/src/component/Error/Error.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { FC } from 'react';
import './Error.scss';
import noResultsImg from '../../asset/no-results-crop.webp';

interface ErrorProps {
message: string;
Expand All @@ -8,7 +9,7 @@ interface ErrorProps {
const Error: FC<ErrorProps> = (props) => {
return (
<div className="error">
<img src="/working.gif"></img>
<img src={noResultsImg}></img>
<h1>404 PAGE NOT FOUND</h1>
<h2>{props.message}</h2>
</div>
Expand Down
6 changes: 4 additions & 2 deletions site/src/component/SideBar/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ import { Icon } from 'semantic-ui-react';
import { XCircle } from 'react-bootstrap-icons';
import { useCookies } from 'react-cookie';
import './Sidebar.scss';
import DefaultAvatar from '../../asset/default-avatar.png';
import defaultAvatarLight from '../../asset/default-avatar.png';
import defaultAvatarDark from '../../asset/default-avatar-dark.png';
import { Button } from 'react-bootstrap';

import { useAppSelector, useAppDispatch } from '../..//store/hooks';
Expand All @@ -20,6 +21,7 @@ const SideBar = () => {
const [picture, setPicture] = useState('');
const [isAdmin, setIsAdmin] = useState<boolean>(false);
const { darkMode, setTheme } = useContext(ThemeContext);
const defaultAvatar = darkMode ? defaultAvatarDark : defaultAvatarLight;

const isLoggedIn = cookies.user !== undefined;

Expand Down Expand Up @@ -141,7 +143,7 @@ const SideBar = () => {

{/* Profile Icon and Name */}
<div className="sidebar-profile">
<img src={picture ? picture : DefaultAvatar} />
<img src={picture ? picture : defaultAvatar} />
<p>{name ? name : 'Anonymous Peter'}</p>
</div>

Expand Down

0 comments on commit bc8666d

Please sign in to comment.