-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: improve performance and layout of agenda pages (#72)
* refactor: improve performance and layout of agenda pages * ci: add prettier * feat: mid day split in home * feat: Add keynote and room labels to speaker card (#73) * feat: Add keynote and room labels to speaker card * style: improve spacing of button group
- Loading branch information
1 parent
932c6eb
commit 8d7fe4f
Showing
12 changed files
with
237 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export default { | ||
semi: true, | ||
trailingComma: "es5", | ||
singleQuote: false, | ||
printWidth: 100, | ||
tabWidth: 2, | ||
useTabs: false, | ||
bracketSpacing: true, | ||
arrowParens: "always", | ||
endOfLine: "lf", | ||
quoteProps: "as-needed", | ||
jsxSingleQuote: false, | ||
htmlWhitespaceSensitivity: "strict", | ||
vueIndentScriptAndStyle: false, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,29 @@ | ||
export type TalkCategory = 'Convida' | 'Frontend' | 'Comunidades'; | ||
export type TalkCategory = "Convida" | "Frontend" | "Comunidades"; | ||
|
||
export interface Agenda extends Record<TalkCategory, Palestra[]>{ | ||
[type: string]: Palestra[] | ||
export interface Agenda extends Record<TalkCategory, Palestra[]> { | ||
[type: string]: Palestra[]; | ||
} | ||
|
||
export interface Palestra { | ||
speaker: Speaker | ||
keynote?: boolean | ||
room: string | ||
hour: string | ||
id: number | ||
title: string | ||
tags: string[] | ||
speaker: Speaker; | ||
keynote?: boolean; | ||
room: string; | ||
hour: string; | ||
id: number; | ||
title: string; | ||
tags: string[]; | ||
} | ||
|
||
export interface Speaker { | ||
role: string | ||
company: string | ||
bio: string | ||
social_link: string | ||
id: number | ||
title: string | ||
image: string | ||
export interface PalestraWithRoom extends Palestra { | ||
room: string; | ||
} | ||
|
||
export interface Speaker { | ||
role: string; | ||
company: string; | ||
bio: string; | ||
social_link: string; | ||
id: number; | ||
title: string; | ||
image: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,23 @@ | ||
import { cn } from "@/lib/utils"; | ||
import { Link } from "react-router-dom"; | ||
|
||
export const LinkAgenda = () => { | ||
const linkCN = cn("text-white underline text-nowrap"); | ||
|
||
export const LinkAgenda = ({ isMyAgenda }: { isMyAgenda?: boolean }) => { | ||
return ( | ||
<div className="flex flex-wrap gap-8 sm:justify-between justify-center items-center"> | ||
<Link className="text-white underline text-nowrap" to="/lives"> | ||
Acontecendo agora | ||
<div className="flex flex-wrap gap-8 justify-center items-center"> | ||
{/* <Link className={linkCN} to='/lives'> | ||
Acontecendo agora | ||
</Link> */} | ||
{isMyAgenda ? ( | ||
<Link className={linkCN} to="/"> | ||
Agenda completa | ||
</Link> | ||
<Link className="text-white underline text-nowrap" to="/agenda"> | ||
Ver minha agenda > | ||
) : ( | ||
<Link className={linkCN} to="/agenda"> | ||
Ver minha agenda > | ||
</Link> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,5 @@ | ||
import { getAgenda } from '@/api'; | ||
import {useQuery} from 'react-query'; | ||
import { getAgenda } from "@/api"; | ||
import { useQuery } from "react-query"; | ||
|
||
|
||
export const useAgenda = () =>{ | ||
const data = useQuery(['agenda'], {queryFn: getAgenda, staleTime: Infinity}); | ||
|
||
return data; | ||
} | ||
export const useAgenda = () => | ||
useQuery(["agenda"], { queryFn: getAgenda, staleTime: Infinity }); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { Agenda, Palestra, PalestraWithRoom } from "@/api/types"; | ||
|
||
export const splitTalksToMidDay = (talks: PalestraWithRoom[] | Palestra[]) => { | ||
const talksBeforeMidDay = talks.filter( | ||
(item) => item.hour.split(":")[0] < "12", | ||
); | ||
const talksAfterMidDay = talks.filter( | ||
(item) => item.hour.split(":")[0] >= "12", | ||
); | ||
|
||
return { talksBeforeMidDay, talksAfterMidDay }; | ||
}; | ||
|
||
export const agendaResponseToTalks = (data: Agenda): PalestraWithRoom[] => { | ||
return Object.entries(data).reduce((acc, [key, value]) => { | ||
return acc.concat(value.map((talk) => ({ ...talk, room: key }))); | ||
}, [] as PalestraWithRoom[]); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.