-
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.
- Loading branch information
Showing
9 changed files
with
419 additions
and
333 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
Large diffs are not rendered by default.
Oops, something went wrong.
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,51 @@ | ||
import type { Component } from "solid-js"; | ||
import { type Component, Show, createMemo } from "solid-js"; | ||
|
||
import type { Subject } from "~/context/types"; | ||
import { courseColor, getColorClass } from "~/lib/colors"; | ||
|
||
import { Box } from "styled-system/jsx"; | ||
import { Card } from "~/components/ui/card"; | ||
import { Text } from "~/components/ui/text"; | ||
|
||
import type { SelectedSubjects } from "~/context/types"; | ||
import { Button } from "./ui/button"; | ||
|
||
const Class: Component<{ | ||
classIndex: number; | ||
classInfo: "placeholder" | Subject; | ||
classInfo: "placeholder" | SelectedSubjects; | ||
semesterIndex: number; | ||
// warnings: string[]; | ||
warnings: string[]; | ||
}> = (props) => { | ||
return <div />; | ||
const classInfo = createMemo(() => { | ||
if (props.classInfo === "placeholder") { | ||
return undefined; | ||
} | ||
return props.classInfo; | ||
}); | ||
|
||
return ( | ||
<Show when={classInfo()} fallback={"placeholder"}> | ||
{(shownClassInfo) => ( | ||
<Button | ||
width="48" | ||
height="24" | ||
variant="solid" | ||
overflowY="hidden" | ||
textWrap="wrap" | ||
className={getColorClass(courseColor(shownClassInfo()))} | ||
> | ||
<Text> | ||
<Text as="span" fontWeight="bold"> | ||
{shownClassInfo().subject_id}{" "} | ||
</Text> | ||
|
||
<Text as="span" fontWeight="medium"> | ||
{shownClassInfo().title} | ||
</Text> | ||
</Text> | ||
</Button> | ||
)} | ||
</Show> | ||
); | ||
}; | ||
|
||
export default Class; |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
export * as Card from './styled/card' |
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,38 @@ | ||
import { type Assign, type PolymorphicProps, ark } from '@ark-ui/solid' | ||
import type { ComponentProps } from 'solid-js' | ||
import { card } from 'styled-system/recipes' | ||
import type { HTMLStyledProps } from 'styled-system/types' | ||
import { createStyleContext } from './utils/create-style-context' | ||
|
||
const { withProvider, withContext } = createStyleContext(card) | ||
|
||
export type RootProps = ComponentProps<typeof Root> | ||
export const Root = withProvider<Assign<HTMLStyledProps<'div'>, PolymorphicProps<'div'>>>( | ||
ark.div, | ||
'root', | ||
) | ||
|
||
export const Body = withContext<Assign<HTMLStyledProps<'div'>, PolymorphicProps<'div'>>>( | ||
ark.div, | ||
'body', | ||
) | ||
|
||
export const Description = withContext<Assign<HTMLStyledProps<'div'>, PolymorphicProps<'div'>>>( | ||
ark.div, | ||
'description', | ||
) | ||
|
||
export const Footer = withContext<Assign<HTMLStyledProps<'div'>, PolymorphicProps<'div'>>>( | ||
ark.div, | ||
'footer', | ||
) | ||
|
||
export const Header = withContext<Assign<HTMLStyledProps<'div'>, PolymorphicProps<'div'>>>( | ||
ark.div, | ||
'header', | ||
) | ||
|
||
export const Title = withContext<Assign<HTMLStyledProps<'h3'>, PolymorphicProps<'h3'>>>( | ||
ark.h3, | ||
'title', | ||
) |
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.