Skip to content

Commit 046297a

Browse files
committed
add first alg problems (fizzbuzz, fib, palindrome)
1 parent 364cf5d commit 046297a

File tree

12 files changed

+115
-95
lines changed

12 files changed

+115
-95
lines changed
Lines changed: 49 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,55 @@
1-
import { ComponentProperties } from "@bennie-ui/types";
1+
import { SectionProperties } from "@bennie-ui/section";
22

33
type HeaderStyles = {
4-
container: ComponentProperties;
4+
container: SectionProperties;
5+
outer: SectionProperties;
6+
inner: SectionProperties;
57
};
6-
export const header_styles: HeaderStyles = {
8+
export const HeaderStyles: HeaderStyles = {
79
container: {
8-
margin: { all: "2" },
9-
height: { value: "12" },
10-
flex: { justifyContent: "between", alignItems: "center" },
11-
colors: { text: { color: "white" } },
10+
height: { value: "14" },
11+
padding: { all: "3" },
12+
colors: { border: { color: "gray" } },
13+
border: { style: "solid", width: { b: "1" } },
14+
flex: {
15+
alignItems: "end",
16+
},
17+
width: {
18+
value: "full",
19+
},
20+
overrides: {
21+
large: {
22+
padding: { all: "2" },
23+
},
24+
},
25+
},
26+
outer: {
27+
width: {
28+
value: "full",
29+
},
30+
flex: {
31+
justifyContent: "center",
32+
},
33+
},
34+
inner: {
35+
align: {
36+
y: "bottom",
37+
},
38+
width: {
39+
value: "full",
40+
},
41+
flex: {
42+
direction: "row",
43+
justifyContent: "between",
44+
alignItems: "end",
45+
},
46+
47+
overrides: {
48+
large: {
49+
width: {
50+
value: "2/3",
51+
},
52+
},
53+
},
1254
},
1355
};

app/components/header/header.tsx

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,19 @@
1-
import { FC } from "react";
2-
import { Icon } from "@bennie-ui/icons";
3-
import { Button } from "@bennie-ui/button";
1+
import React, { FC } from "react";
42
import { Section } from "@bennie-ui/section";
3+
import { Link } from "@bennie-ui/text";
54

6-
import { header_styles } from "./header.styles";
5+
import { HeaderStyles } from "./header.styles";
76
export const Header: FC = () => {
87
return (
9-
<div className="header-wrapper">
10-
<header>
11-
<Section {...header_styles.container}>
12-
<Section flex={{ justifyContent: "start", alignItems: "center" }}>
13-
<Section size="2xl">Bolanos Dev</Section>
14-
</Section>
15-
<Section>
16-
<Button onClick={() => {}}>
17-
<Icon
18-
figure="UserIcon"
19-
colors={{ text: { color: "black" } }}
20-
dark={{ colors: { text: { color: "white" } } }}
21-
/>
22-
</Button>
23-
</Section>
8+
<Section id="header" {...HeaderStyles.container}>
9+
<Section id="header-outer" {...HeaderStyles.outer}>
10+
<Section id="header-inner" {...HeaderStyles.inner}>
11+
<Link size="xl" href="/">
12+
BolanosDev
13+
</Link>
14+
<Section>Docs</Section>
2415
</Section>
25-
</header>
26-
</div>
16+
</Section>
17+
</Section>
2718
);
2819
};

app/components/header/logo.tsx

Lines changed: 0 additions & 18 deletions
This file was deleted.

app/components/page/page.tsx

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,17 @@
11
import React, { FC, ReactNode } from "react";
22
import { Section } from "@bennie-ui/section";
3-
import { Link } from "@bennie-ui/text";
3+
import { Header } from "../header";
44
import { GlobalStyles } from "../../styles";
55
type PageProps = {
66
children: ReactNode;
77
};
88

9-
export const meta: MetaFunction = () => {
10-
return [
11-
{ title: "BolanosDev" },
12-
{
13-
name: "description",
14-
content: "Welcome to BolanosDev!",
15-
},
16-
];
17-
};
18-
199
export const Page: FC<PageProps> = ({ children }) => {
2010
return (
21-
<Section id="outer" {...GlobalStyles.wrappers.outer}>
22-
<Section id="inner" {...GlobalStyles.wrappers.inner}>
23-
<Section
24-
id="header"
25-
height={{ value: "8" }}
26-
flex={{
27-
direction: "row",
28-
alignContent: "baseline",
29-
justifyContent: "between",
30-
alignItems: "center",
31-
}}
32-
>
33-
<Link size="xl" href="/">
34-
BolanosDev
35-
</Link>
36-
<Section>Docs</Section>
37-
</Section>
38-
<Section id="content" padding={{ all: "8" }} height={{ value: "full" }}>
11+
<Section id="page" {...GlobalStyles.wrappers.container}>
12+
<Header />
13+
<Section id="" {...GlobalStyles.wrappers.outer}>
14+
<Section id="content" {...GlobalStyles.wrappers.inner}>
3915
{children}
4016
</Section>
4117
</Section>

app/components/player/index.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ export const Player: FC<PlayerProps> = ({
111111

112112
return (
113113
<Section
114-
margin={{ top: "8" }}
115114
rounding={{ all: "2xl" }}
116115
border={{ style: "solid", width: { all: "2" } }}
117116
>

app/components/sidebar/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./sidebar";

app/components/sidebar/sidebar.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import React, { FC } from "react";
2+
import { Link } from "@bennie-ui/text";
3+
import { Section } from "@bennie-ui/section";
4+
5+
export const Sidebar: FC = () => {
6+
return (
7+
<Section>
8+
<Link href="/interviews" colors={{ text: { color: "white" } }}>
9+
Interviews
10+
</Link>
11+
<Section flex={{ direction: "col" }}>
12+
<Link href="/interviews/fizzbuzz">FizzBuzz</Link>
13+
<Link href="/interviews/fibonacci">Fibonacci</Link>
14+
<Link href="/interviews/palindromes">Palindromes</Link>
15+
</Section>
16+
</Section>
17+
);
18+
};

app/routes/examples.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export default function Examples() {
66
<div>
77
<h1>Example</h1>
88

9-
<Section grid={{ templates: { columns: "5" } }}>
9+
<Section align={{ x: "center" }}>
1010
<div>item1</div>
1111
<div>item2</div>
1212
<div>item3</div>

app/routes/interviews.fibonacci.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export default function Index() {
6666
{data.map((it, idx) => (
6767
<Section
6868
key={idx}
69-
align="center"
69+
align={{ x: "center" }}
7070
rounding={{ all: "md" }}
7171
border={{ style: "solid", width: { all: "1" } }}
7272
colors={{ background: { color: "blue", weight: "400" } }}

app/routes/interviews.fizzbuzz.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export default function Index() {
4444
{data.map((it, idx) => (
4545
<Section
4646
key={idx}
47-
align="center"
47+
align={{ x: "center" }}
4848
rounding={{ all: "md" }}
4949
border={{ style: "solid", width: { all: "1" } }}
5050
colors={{ background: { color: "blue", weight: "400" } }}

0 commit comments

Comments
 (0)