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

🎨 - Fixed anti patern js-0108 #21

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,css,scss,md}\" --config ./.prettierrc",
"clean": "rimraf dist",
"start": "parcel",
"dev": "parcel",
"watch": "parcel watch",
"build": "npm run clean && npm run format && parcel build",
"serve": "npm run build && npm run start"
Expand Down
2 changes: 1 addition & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useEffect } from 'react';

// Providers
import AuthProvider from './Providers/AuthProvider';
Expand Down
6 changes: 4 additions & 2 deletions src/Components/Burger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ const Burger = ({ open, setOpen, ...props }) => {
type='button'
className={open ? 'menu opened' : 'menu'}
onClick={() => setOpen(!open)}
aria-label={open ? 'Close Menu' : 'Open Menu'}>
aria-label={open ? 'Close Menu' : 'Open Menu'}
>
<svg
width='50'
height='50'
viewBox='0 0 100 100'
aria-label='burger-menu'>
aria-label='burger-menu'
>
<path
className='line line1'
d='M 20,29.000046 H 80.000231 C 80.000231,29.000046 94.498839,28.817352 94.532987,66.711331 94.543142,77.980673 90.966081,81.670246 85.259173,81.668997 79.552261,81.667751 75.000211,74.999942 75.000211,74.999942 L 25.000021,25.000058'
Expand Down
9 changes: 6 additions & 3 deletions src/Components/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ const Navbar = () => {
<nav>
<ul
aria-hidden={open ? 'false' : 'true'}
className={open ? 'nav-links open' : 'nav-links'}>
className={open ? 'nav-links open' : 'nav-links'}
>
{Pages.map((page) => {
if (hasPermission(page.reqAuthState)) {
return (
Expand All @@ -124,7 +125,8 @@ const Navbar = () => {
}`}
aria-hidden={open ? 'false' : 'true'}
tabIndex={open ? 0 : -1}
onClick={handleLinkClick}>
onClick={handleLinkClick}
>
{page.name}
</Link>
</li>
Expand All @@ -141,7 +143,8 @@ const Navbar = () => {
type='button'
aria-hidden={open ? 'false' : 'true'}
tabIndex={open ? 0 : -1}
onClick={() => button.action(handleLinkClick)}>
onClick={() => button.action(handleLinkClick)}
>
{button.label}
</button>
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/Pages/Cards.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useState, useEffect } from 'react';
import { Cards as CardList, Card } from '../types/card';
import { Card } from '../classes/Card';
import { Cards as CardList } from '../classes/Cards';

const Cards = () => {
const [cardsList, setCardsList] = useState<Card[]>([]);
Expand Down
6 changes: 2 additions & 4 deletions src/Pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,15 @@ const Home = () => {
height: '40vh',
width: '100%',
textAlign: 'center',
}}
>
}}>
<h1>&lt;/&gt; AvaRose</h1>
</div>
<section
style={{
margin: '0 auto',
textAlign: 'center',
maxWidth: '800px',
}}
>
}}>
<h2>🎉 Welcome to my website 👋</h2>
<p>
My name is Avery and I am a College Student at{' '}
Expand Down
18 changes: 6 additions & 12 deletions src/Pages/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ const Settings = () => {
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
}}
>
}}>
<Avatar src={avatar} style={{ width: 100, height: 100 }} />
<h4 style={{ textAlign: 'center', marginTop: '1rem' }}>
{user?.displayName}
Expand All @@ -57,8 +56,7 @@ const Settings = () => {
style={{
textAlign: 'center',
marginTop: '0.5rem',
}}
>
}}>
{email}
</h5>
<div
Expand All @@ -68,17 +66,15 @@ const Settings = () => {
alignItems: 'center',
marginTop: '1rem',
gap: '1rem',
}}
>
}}>
<span>Reveal</span>
<Switch bordered onChange={toggleShowEmail} checked={displayEmail} />
</div>
<Button
onClick={() => {
signOut(getAuth());
}}
style={{ marginTop: '1rem' }}
>
style={{ marginTop: '1rem' }}>
Sign Out
</Button>
</Container>
Expand All @@ -88,8 +84,7 @@ const Settings = () => {
flexDirection: 'column',
justifyContent: 'center',
alignItems: 'center',
}}
>
}}>
{/* <FormControlLabel
control={<Switch />}
label='Dark Mode'
Expand All @@ -98,8 +93,7 @@ const Settings = () => {
<h4
style={{
textAlign: 'center',
}}
>
}}>
🚧 Under Construction 🚧
</h4>
</div>
Expand Down
13 changes: 13 additions & 0 deletions src/classes/Card.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { ICard } from '../interfaces/Card';

export class Card {
id: number;
name: string;
body: string;

constructor({ id, name, body }: ICard) {
this.id = id;
this.name = name;
this.body = body;
}
}
24 changes: 3 additions & 21 deletions src/types/card.ts → src/classes/Cards.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,6 @@
export interface ICard {
id: number;
name: string;
body: string;
}

export interface ICardList {
cards: ICard[];
}

export class Card {
id: number;
name: string;
body: string;

constructor({ id, name, body }: ICard) {
this.id = id;
this.name = name;
this.body = body;
}
}
import { Card } from './Card';
import { ICard } from '../interfaces/Card';
import { ICardList } from '../interfaces/CardList';

export class Cards {
cards: Card[];
Expand Down
5 changes: 5 additions & 0 deletions src/interfaces/Card.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export interface ICard {
id: number;
name: string;
body: string;
}
5 changes: 5 additions & 0 deletions src/interfaces/CardList.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { ICard } from './Card';

export interface ICardList {
cards: ICard[];
}
Loading