Skip to content

Commit

Permalink
Conversion to Tailwind and thec3.uk design
Browse files Browse the repository at this point in the history
  • Loading branch information
nanorepublica committed Aug 7, 2022
1 parent 9130018 commit 1f4cfd5
Show file tree
Hide file tree
Showing 106 changed files with 35,288 additions and 2,913 deletions.
53 changes: 23 additions & 30 deletions app/components/AdditionalResources/index.tsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,25 @@
import { Box, Heading, List, ListItem } from '@chakra-ui/react';
import { Resource } from '~/routes/series/series.types';
import { Resource } from "~/routes/series/series.types";
import { layout } from "../components";

export function AdditionalResources({
resources,
}: {
resources?: Array<Resource>;
}) {
return resources ? (
<Box p={10} w={'100%'}>
<Heading as="h2" size={'md'}>
Additional Resources
</Heading>
<Box paddingTop={2}>
<List>
{resources?.map(resource => (
<ListItem key={resource.title}>
<a href={resource.url} target={'_blank'}>
{resource.title}{' '}
{resource.description && (
<span> - {resource.description}</span>
)}
</a>
</ListItem>
))}
</List>
</Box>
</Box>
) : (
<></>
);
export function AdditionalResources({ resources }: { resources?: Array<Resource> }) {
return resources ? (
<layout.Main hash="additional-resources">
<div className="prose">
<h2 className="text-lg">Additional Resources</h2>
<div className="pt-2">
<ul>
{resources?.map((resource) => (
<li key={resource.title}>
<a href={resource.url} target="_blank">
{resource.title} {resource.description && <span> - {resource.description}</span>}
</a>
</li>
))}
</ul>
</div>
</div>
</layout.Main>
) : (
<></>
);
}
38 changes: 16 additions & 22 deletions app/components/Channels/index.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
import { Channel } from '~/routes/channels/channels.types';
import { ImageGrid } from '../ImageGrid';
import { Theme } from '../ImageGrid/imageGrid.types';
import { Channel } from "~/routes/channels/channels.types";
import { ImageGrid } from "../ImageGrid";
import { Theme } from "../ImageGrid/imageGrid.types";

export function Channels({
channels,
theme,
}: {
channels: Array<Channel>;
theme: Theme;
}) {
return (
<ImageGrid
theme={theme}
title="Browse Channels"
items={channels.map(channel => ({
key: channel.uid,
link: `/channels/${channel.uid}`,
title: channel.name,
thumbnail: channel.thumbnail?.url,
}))}
/>
);
export function Channels({ channels, theme }: { channels: Array<Channel>; theme: Theme }) {
return (
<ImageGrid
theme={theme}
title="Channel"
items={channels.map((channel) => ({
key: channel.uid,
link: `/channels/${channel.uid}`,
title: channel.name,
thumbnail: channel.thumbnail?.url,
}))}
/>
);
}
49 changes: 23 additions & 26 deletions app/components/FeaturedChannel/index.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,25 @@
import { Box, HStack, Text, Image } from '@chakra-ui/react';
import YouTubePlayer from 'react-player/youtube';
import { Channel } from '~/routes/channels/channels.types';
import { VideoBanner } from '../VideoBanner/videoBanner';
import YouTubePlayer from "react-player/youtube";
import { Channel } from "~/routes/channels/channels.types";
import { VideoBanner } from "../VideoBanner/videoBanner";

export function FeaturedChannel({
channel,
video,
}: {
channel: Channel;
video: string | undefined;
}) {
return (
<Box p={10} w={'100%'} bg={'gray.300'}>
<HStack>
<Box boxShadow="0px 0px 5px 1px grey">
<YouTubePlayer url={video} />
</Box>
<Text p={4}>{channel.description}</Text>
<Image
src={channel.thumbnail?.url}
w={'128px'}
borderRadius={'full'}
/>
</HStack>
</Box>
);
import { PrismicRichText } from "@prismicio/react";
import { Speaker } from "~/routes/speakers/speakers.types";
import { layout, components } from "../components";

export function FeaturedChannel({ channel, video }: { channel: Channel; video: string | undefined }) {
// fallback with an image?
const background = <YouTubePlayer url={video} />;
return (
<layout.Hero background={background}>
<img src={channel.thumbnail?.url} className="w-20 rounded-full" />
<h1 className="font-title font-bold text-5.5xl lowercase">{channel.name}</h1>
{/* <div className="mt-2 font-sans text-3xl">
<PrismicRichText field={speaker.role} />
</div> */}
<div className="px-2 py-2 mt-8 -mx-2 text-2xl">
<PrismicRichText field={channel.description} />
</div>
<div className="flex flex-col mt-8 space-y-4 text-2xl"></div>
</layout.Hero>
);
}
18 changes: 0 additions & 18 deletions app/components/Footer/index.tsx

This file was deleted.

47 changes: 0 additions & 47 deletions app/components/Header/index.tsx

This file was deleted.

51 changes: 0 additions & 51 deletions app/components/ImageBox/index.tsx

This file was deleted.

19 changes: 11 additions & 8 deletions app/components/ImageGrid/imageGrid.types.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
import { Channel } from "~/routes/channels/channels.types";

export interface IImageBoxProps {
key: string;
link: string;
title: string;
thumbnail?: string;
subTitle?: string;
trailer?: string;
key: string;
link: string;
title: string;
thumbnail?: string;
subTitle?: string;
trailer?: string;
channel?: Channel;
}

export enum Theme {
light,
dark,
light,
dark,
}
68 changes: 26 additions & 42 deletions app/components/ImageGrid/index.tsx
Original file line number Diff line number Diff line change
@@ -1,47 +1,31 @@
import { Box, Button, Center, Heading, SimpleGrid } from '@chakra-ui/react';
import { Link } from 'remix';
import { ImageBox } from '../ImageBox';
import { IImageBoxProps, Theme } from './imageGrid.types';
import { Link } from "remix";
import { components, layout } from "../components";

import { IImageBoxProps, Theme } from "./imageGrid.types";

export function ImageGrid({
title,
items,
theme = Theme.light,
link,
title,
items,
theme = Theme.light,
link,
}: {
title: string;
items: Array<IImageBoxProps>;
theme?: Theme;
link?: {
label: string;
url: string;
};
title: string;
items: Array<IImageBoxProps>;
theme?: Theme;
link?: {
label: string;
url: string;
};
}) {
return (
<Box p={10} w={'100%'} bg={theme === Theme.dark ? 'gray.300' : 'white'}>
<Heading as="h3" size={'md'} mb={2}>
{title}
</Heading>
<SimpleGrid minChildWidth={'256px'} spacing="40px">
{items.map((box, idx) => {
return (
<ImageBox
key={box.key + idx}
box={box}
theme={theme}
></ImageBox>
);
})}
</SimpleGrid>
<Center pt={5}>
{link && (
<Link to={link.url}>
<Button borderRadius={'lg'} fontWeight={'400'}>
{link.label}
</Button>
</Link>
)}
</Center>
</Box>
);
return (
<>
{items.map((box, idx) => {
return (
<layout.Main hash={box.key + idx} key={box.key + idx}>
<components.ImageCard title={title} subtitle={box.title} image={box.thumbnail as string} link={box.link} />
</layout.Main>
);
})}
</>
);
}
Loading

0 comments on commit 1f4cfd5

Please sign in to comment.