Skip to content

Commit

Permalink
Merge pull request #186 from Andres2D/remove-errors-and-add-title
Browse files Browse the repository at this point in the history
Remove errors and add title
  • Loading branch information
Andres2D authored Jan 22, 2023
2 parents 41f631b + e2e020e commit cee6fa5
Show file tree
Hide file tree
Showing 13 changed files with 169 additions and 139 deletions.
21 changes: 21 additions & 0 deletions accessibility/header-setting.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type { NextPage } from 'next';
import Head from 'next/head';

interface Props {
title?: string;
description?: string;
}

const HeaderSettings: NextPage<Props> = ({title = 'CotejoApp', description = 'CotejoApp'}) => {
return (
<Head>
<title>{title}</title>
<meta
name='description'
content={description}
/>
</Head>
)
}

export default HeaderSettings;
6 changes: 3 additions & 3 deletions components/layout/navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const Navbar: NextPage = () => {
/>
<Avatar
className={styles.avatar}
src={image || 'https://bit.ly/broken-link'}
src={image || ''}
onClick={onOpen}
ref={btnRef}
/>
Expand All @@ -61,7 +61,7 @@ const Navbar: NextPage = () => {
<DrawerHeader className={styles.headerMenu}>
<Avatar
className={styles.avatarMenu}
src={image || 'https://bit.ly/broken-link'}
src={image || ''}
onClick={() => {
onClose();
router.push('/profile');
Expand Down Expand Up @@ -99,7 +99,7 @@ const Navbar: NextPage = () => {
>
Log out
</Button>
<p>Version 2.3.0</p>
<p>Version 2.3.1</p>
</DrawerFooter>
</DrawerContent>
</Drawer>
Expand Down
2 changes: 1 addition & 1 deletion components/matches/detail/avatar/change-player.modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ const ChangePlayerModal: NextPage = () => {
<div className={styles.playerAction}>
<Avatar
size='lg'
src={inPlayer?.image || 'https://bit.ly/broken-link'}
src={inPlayer?.image || ''}
/>
<div className={styles.inputChange}>
<Input
Expand Down
4 changes: 2 additions & 2 deletions components/profile/player-card/avatar-selector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const AvatarSelector: NextPage = () => {
<div className={styles.container} key={key}>
<Avatar
className={styles.avatarList}
src={src || 'https://bit.ly/broken-link'}
src={src || ''}
size="xl"
onClick={() => changeAvatarHandler(src)}
/>
Expand All @@ -71,7 +71,7 @@ const AvatarSelector: NextPage = () => {
<div className={styles.avatarContainer} onClick={onOpen}>
<Avatar
className={styles.avatar}
src={image || 'https://bit.ly/broken-link'}
src={image || ''}
size="2xl"
/>
<IconButton
Expand Down
66 changes: 22 additions & 44 deletions constants/players-bots-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,176 +5,154 @@ export const botsData: IPlayerList[] = [
nationality: 'World',
position: 'CM',
name: 'Bot one',
image:
'https://bit.ly/broken-link',
image: '',
_id: '637917fe1ad0a31f963f8ccd',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Two',
image:
'https://bit.ly/broken-link',
image: '',
_id: '6379187a1ad0a31f963f8cdc',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Three',
image:
'https://bit.ly/broken-link',
image: '',
_id: '637918931ad0a31f963f8ce5',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Four',
image:
'https://bit.ly/broken-link',
image: '',
_id: '637c1082f70e87605d1e699d',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Five',
image:
'https://bit.ly/broken-link',
image: '',
_id: '637918a91ad0a31f963f8cee',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Six',
image:
'https://bit.ly/broken-link',
image: '',
_id: '637918c51ad0a31f963f8cf7',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Seven',
image:
'https://bit.ly/broken-link',
image: '',
_id: '637918e61ad0a31f963f8d00',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Eight',
image:
'https://bit.ly/broken-link',
image: '',
_id: '637919111ad0a31f963f8d09',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Nine',
image:
'https://bit.ly/broken-link',
image: '',
_id: '637919321ad0a31f963f8d12',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Ten',
image:
'https://bit.ly/broken-link',
image: '',
_id: '637919451ad0a31f963f8d18',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Eleven',
image:
'https://bit.ly/broken-link',
image: '',
_id: '6379195b1ad0a31f963f8d1e',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Twelve',
image:
'https://bit.ly/broken-link',
image: '',
_id: '637919b41ad0a31f963f8d24',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Thirteen',
image:
'https://bit.ly/broken-link',
image: '',
_id: '637919de1ad0a31f963f8d2a',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Fourteen',
image:
'https://bit.ly/broken-link',
image: '',
_id: '63791a011ad0a31f963f8d30',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Fiveteen',
image:
'https://bit.ly/broken-link',
image: '',
_id: '63791a1b1ad0a31f963f8d36',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Sixteen',
image:
'https://bit.ly/broken-link',
image: '',
_id: '63791a321ad0a31f963f8d3c',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Seventeen',
image:
'https://bit.ly/broken-link',
image: '',
_id: '63791a511ad0a31f963f8d42',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Eighteen',
image:
'https://bit.ly/broken-link',
image: '',
_id: '63791b081ad0a31f963f8d48',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Nineteen',
image:
'https://bit.ly/broken-link',
image: '',
_id: '63791b291ad0a31f963f8d4e',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Twenty',
image:
'https://bit.ly/broken-link',
image: '',
_id: '63791b491ad0a31f963f8d54',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Twenty One',
image:
'https://bit.ly/broken-link',
image: '',
_id: '63791b711ad0a31f963f8d5a',
},
{
nationality: 'World',
position: 'CM',
name: 'Bot Twenty Two',
image:
'https://bit.ly/broken-link',
image: '',
_id: '63791b881ad0a31f963f8d60',
},
];
2 changes: 1 addition & 1 deletion pages/api/player/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const registerPlayer = async(req: any, res: any) => {
nickname: name,
number: 0,
status: '',
image: 'https://bit.ly/broken-link',
image: '',
google: false,
nationality: 'Colombia',
position: 'CM'
Expand Down
34 changes: 19 additions & 15 deletions pages/auth/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,28 @@ import { Link, Image } from '@chakra-ui/react';
import { getSession } from 'next-auth/react';
import styles from './index.module.scss';
import LoginForm from '../../components/auth/login-form';
import HeaderSettings from '../../accessibility/header-setting';

const Login: NextPage = () => {
return (
<div className={styles.login}>
<Image
src={'/images/app-logo-regular.png'}
alt='Cotejo app logo'
width={325}
height={219}
className={styles.logo}
/>
<LoginForm />
<NextLink href='/sign-up'>
<Link className={styles.signUpLink}>
{`Don't have an account?, Sign up`}
</Link>
</NextLink>
</div>
<>
<HeaderSettings title='Login' description='Login to CotejoApp' />
<div className={styles.login}>
<Image
src={'/images/app-logo-regular.png'}
alt='Cotejo app logo'
width={325}
height={219}
className={styles.logo}
/>
<LoginForm />
<NextLink href='/sign-up'>
<Link className={styles.signUpLink}>
{`Don't have an account?, Sign up`}
</Link>
</NextLink>
</div>
</>
);
}

Expand Down
9 changes: 8 additions & 1 deletion pages/matches/[...matchId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import type { NextPage } from 'next';
import { getSession } from 'next-auth/react';
import { useEffect } from 'react';
import { useDispatch } from 'react-redux';
import HeaderSettings from '../../../accessibility/header-setting';
import MatchDetailsLayout from '../../../components/matches/detail/match-detail';
import { IMatchDetailsResponse } from '../../../interfaces/Match';
import { getMatch } from '../../../server/matches';
Expand Down Expand Up @@ -44,7 +45,13 @@ const MatchDetails: NextPage<Props> = ({match, profile}) => {
}, [dispatch, matchDetail])

return (
<MatchDetailsLayout />
<>
<HeaderSettings
title={`${matchDetail.match.home_team.name} vs ${matchDetail.match.away_team.name}`}
description='Set the line uo'
/>
<MatchDetailsLayout />
</>
);
}

Expand Down
28 changes: 16 additions & 12 deletions pages/matches/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import styles from './matches.module.scss';
import { FullMatch, IMatch } from '../../interfaces/Match';
import { profileActions } from '../../store/profile.slice';
import { getProfile } from '../../server/player';
import HeaderSettings from '../../accessibility/header-setting';

interface Props {
matches: string;
Expand Down Expand Up @@ -41,18 +42,21 @@ const Matches: NextPage<Props> = ({matches, profile}) => {
}, []);

return (
<section className={styles.matches}>
<Button
size='lg'
colorScheme='brand'
onClick={() => router.push('/matches/new')}
>
New Match
</Button>
<MatchList
matches={matchesList}
/>
</section>
<>
<HeaderSettings title='Matches' description='Select your match' />
<section className={styles.matches}>
<Button
size='lg'
colorScheme='brand'
onClick={() => router.push('/matches/new')}
>
New Match
</Button>
<MatchList
matches={matchesList}
/>
</section>
</>
);
}

Expand Down
Loading

1 comment on commit cee6fa5

@vercel
Copy link

@vercel vercel bot commented on cee6fa5 Jan 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

cotejoapp – ./

cotejoapp.vercel.app
cotejoapp-git-main-andres2d.vercel.app
cotejoapp-andres2d.vercel.app

Please sign in to comment.