-
Notifications
You must be signed in to change notification settings - Fork 1
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
Danielle/535 add current entry number in header of entry page #615
Changes from 8 commits
8d5e534
2036a63
5d70e71
f569672
d2ffa9e
89459e3
c646f00
bfe5b50
1fd9e8e
3d90bc5
20f6e29
efc93b0
d8823c8
9acaef7
abf45a7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,7 @@ import Image from 'next/image'; | |
import { useRouter } from 'next/navigation'; | ||
import LinkCustom from '@/components/LinkCustom/LinkCustom'; | ||
import { ChevronLeft } from 'lucide-react'; | ||
import Heading from '@/components/Heading/Heading'; | ||
|
||
/** | ||
* Renders the weekly picks page. | ||
|
@@ -43,6 +44,7 @@ import { ChevronLeft } from 'lucide-react'; | |
// eslint-disable-next-line no-unused-vars | ||
const Week = ({ entry, league, NFLTeams, week }: IWeekProps): JSX.Element => { | ||
const [pickHistory, setPickHistory] = useState<string[]>([]); | ||
const [entryName, setEntryName] = useState<string>(''); | ||
const [error, setError] = useState<string | null>(null); | ||
const [schedule, setSchedule] = useState<ISchedule[]>([]); | ||
const [selectedLeague, setSelectedLeague] = useState<ILeague | undefined>(); | ||
|
@@ -156,7 +158,8 @@ const Week = ({ entry, league, NFLTeams, week }: IWeekProps): JSX.Element => { | |
if (!currentEntry) { | ||
throw new Error('Entry not found'); | ||
} | ||
|
||
|
||
setEntryName(currentEntry.name); | ||
let entryHistory = currentEntry?.selectedTeams || []; | ||
|
||
if (currentEntry?.selectedTeams.length > 0) { | ||
|
@@ -271,10 +274,17 @@ const Week = ({ entry, league, NFLTeams, week }: IWeekProps): JSX.Element => { | |
className="flex flex-col items-center w-full pt-8" | ||
data-testid="weekly-picks" | ||
> | ||
<h1 className="pb-8 text-center text-[2rem] font-bold text-foreground"> | ||
Week {week} pick | ||
</h1> | ||
|
||
<Heading | ||
as='h1' | ||
className='pb-8' | ||
>{`Week ${week} pick`} | ||
</Heading> | ||
<Heading | ||
as='h2' | ||
className='pb-8 text-muted-foreground' | ||
data-testid='entry-name' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's follow BEM naming convention. This should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @shashilo complete |
||
>{`Entry ${entryName}`} | ||
</Heading> | ||
{pickHistory.length > 0 && ( | ||
<section | ||
className="flex flex-wrap w-[90%] gap-4 overflow-x-scroll justify-center pb-10 items-center" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not test that H1 is on the screen and has the correct value as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ryandotfurrer How come all headings do not have
pb-8
by default? Heading's usually have margin from the next element.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shashilo complete