diff --git a/pages/refill.tsx b/pages/refill.tsx index a8b048bee..3632814a1 100644 --- a/pages/refill.tsx +++ b/pages/refill.tsx @@ -1,6 +1,8 @@ import RefillLayout from 'src/refill/layout'; import Image from 'next/image'; import style from 'src/refill/refill.module.css'; +import { TabButton, TabContainer, TabList, TabPanel } from 'src/refill/tabbar'; +import { useState } from 'react'; const dev: ProgramItemProps[] = [ { @@ -70,6 +72,8 @@ const design: ProgramItemProps[] = [ ]; export default function Refill() { + const [panel, setPanel] = useState<'design' | 'dev'>('design'); + return (
@@ -106,6 +110,62 @@ export default function Refill() {
+
+

Se stream

+ + + { + e.preventDefault(); + setPanel('design'); + }} + id={`tab-design`} + title={`Velg design`} + controlsId={`panel-design`} + selected={panel === 'design'} + > + Design + + { + e.preventDefault(); + setPanel('dev'); + }} + id={`tab-dev`} + title={`Velg utvikling`} + controlsId={`panel-dev`} + selected={panel === 'dev'} + > + Utvikling + + + +
+ + + + + + + +
+
+
+

Track: Utvikling

@@ -129,6 +189,27 @@ export default function Refill() { ); } +type YoutubeEmbedProps = { + title: string; + src: string; +}; +function EmbedYouTube({ title, src }: YoutubeEmbedProps) { + return ( +
+ +
+ ); +} + type ProgramItemProps = { speaker: { name: string; diff --git a/src/components/button/button.module.css b/src/components/button/button.module.css index 2db2dfe8c..04d25014c 100644 --- a/src/components/button/button.module.css +++ b/src/components/button/button.module.css @@ -7,7 +7,9 @@ color: var(--color, var(--color-secondary1--text)); border-radius: 0.5rem; font-weight: 500; - transition: background-color 250ms ease-out, scale 100ms ease-out; + transition: + background-color 250ms ease-out, + scale 100ms ease-out; display: inline-block; border-radius: 4rem; @@ -25,3 +27,8 @@ composes: button; text-decoration: none; } + +.button[aria-selected='true'] { + background-color: var(--color-secondary1__shade3); + color: var(--color-secondary1__shade3--text); +} diff --git a/src/components/button/index.tsx b/src/components/button/index.tsx index ca7a688b9..5bfaadbea 100644 --- a/src/components/button/index.tsx +++ b/src/components/button/index.tsx @@ -5,13 +5,13 @@ import { and } from 'src/utils/css'; import style from './button.module.css'; -type ButtonProps = React.PropsWithChildren<{ +export type ButtonProps = React.PropsWithChildren<{ className?: string; colorPair?: ColorSet; colorVariation?: ColorVariations; }>; -type EType = React.DetailedHTMLProps< +export type EType = React.DetailedHTMLProps< React.ButtonHTMLAttributes, HTMLButtonElement >; diff --git a/src/refill/refill.module.css b/src/refill/refill.module.css index 71e11eae1..ae30ac1a9 100644 --- a/src/refill/refill.module.css +++ b/src/refill/refill.module.css @@ -187,3 +187,17 @@ align-items: center; gap: 0.5rem; } + +.ytVideo { + position: relative; + width: 100%; + height: 0; + padding-bottom: 56.25%; +} +.ytVideo iframe { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; +} diff --git a/src/refill/tabbar/index.tsx b/src/refill/tabbar/index.tsx new file mode 100644 index 000000000..578bacd38 --- /dev/null +++ b/src/refill/tabbar/index.tsx @@ -0,0 +1,58 @@ +import { PropsWithChildren } from 'react'; +import style from './tabbar.module.css'; +import { Button, EType as ButtonProps } from '@components/button'; + +type TabProps = { selected?: boolean; controlsId: string } & ButtonProps; +export function TabButton({ + selected = false, + controlsId, + ...props +}: TabProps) { + return ( +