Skip to content

Commit 9469de4

Browse files
committed
first commit
0 parents  commit 9469de4

28 files changed

+12300
-0
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
node_modules
2+
3+
/.cache
4+
/build
5+
/public/build
6+
.env

README.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Welcome to Remix!
2+
3+
- [Remix Docs](https://remix.run/docs)
4+
5+
## Development
6+
7+
From your terminal:
8+
9+
```sh
10+
npm run dev
11+
```
12+
13+
This starts your app in development mode, rebuilding assets on file changes.
14+
15+
## Deployment
16+
17+
First, build your app for production:
18+
19+
```sh
20+
npm run build
21+
```
22+
23+
Then run the app in production mode:
24+
25+
```sh
26+
npm start
27+
```
28+
29+
Now you'll need to pick a host to deploy it to.
30+
31+
### DIY
32+
33+
If you're familiar with deploying node applications, the built-in Remix app server is production-ready.
34+
35+
Make sure to deploy the output of `remix build`
36+
37+
- `build/`
38+
- `public/build/`
39+
40+
### Using a Template
41+
42+
When you ran `npx create-remix@latest` there were a few choices for hosting. You can run that again to create a new project, then copy over your `app/` folder to the new project that's pre-configured for your target server.
43+
44+
```sh
45+
cd ..
46+
# create a new project, and pick a pre-configured host
47+
npx create-remix@latest
48+
cd my-new-remix-app
49+
# remove the new project's app (not the old one!)
50+
rm -rf app
51+
# copy your app over
52+
cp -R ../my-old-remix-app/app app
53+
```

app/components/Button/Button.tsx

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
interface Button extends React.ComponentPropsWithoutRef<"button"> {
2+
className? : string,
3+
icon?: any,
4+
label: string;
5+
size?: 'normal' | 'small',
6+
variant?: 'normal' | 'simple' | 'highlight',
7+
}
8+
export const Button = (props: Button) => {
9+
const {
10+
className = '',
11+
icon = undefined,
12+
label,
13+
type = 'button',
14+
size = 'normal',
15+
variant = 'normal',
16+
...otherProps
17+
} = props
18+
19+
return(
20+
<button
21+
className={`
22+
appearance-none
23+
flex
24+
items-center
25+
justify-center
26+
relative
27+
text-center
28+
transition-all
29+
30+
${size === 'small' ? 'text-sm' : 'text-md'}
31+
${variant === 'normal' ? 'bg-blue-400 font-medium h-9 rounded-md text-white hover:bg-blue-600' : ''}
32+
${variant === 'simple' ? 'text-black-300 hover:text-black' : ''}
33+
${variant === 'highlight' ? 'text-blue-400 hover:text-blue-600' : ''}
34+
35+
${className}
36+
`}
37+
type={type}
38+
{...otherProps}>
39+
{icon &&
40+
<div
41+
className="mr-2">
42+
{icon}
43+
</div>
44+
}
45+
{label}
46+
</button>
47+
)
48+
}
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import {Button} from '~/components/Button/Button'
2+
3+
export const FieldButton = ({
4+
className,
5+
label,
6+
}: {className?: string, label: string}) => (
7+
<Button
8+
className={className}
9+
type="submit"
10+
label={label} />
11+
)

app/components/Fields/Input/Input.tsx

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
interface Input {
2+
label: string;
3+
type?: string;
4+
placeholder?: string | undefined;
5+
description?: string | undefined;
6+
}
7+
8+
export const Input = ({
9+
label,
10+
type = 'text',
11+
placeholder = undefined,
12+
description = undefined,
13+
}: Input) => (
14+
<label
15+
className="
16+
block
17+
w-full
18+
">
19+
<span
20+
className="
21+
font-medium
22+
text-md
23+
text-black-300
24+
">
25+
{label}
26+
</span>
27+
28+
<input
29+
className="
30+
block
31+
border
32+
border-black-200
33+
rounded-md
34+
h-9
35+
px-3
36+
mt-1.5
37+
text-md
38+
text-black-900
39+
w-full
40+
41+
focus:ring-1
42+
focus:ring-black-200
43+
focus:outline-none
44+
"
45+
placeholder={placeholder}
46+
type={type} />
47+
48+
{description &&
49+
<span
50+
className="text-sm text-black-300">{description}</span>}
51+
</label>
52+
)
+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
interface Select {
2+
label: string;
3+
children: any;
4+
placeholder?: string | undefined;
5+
description?: string | undefined;
6+
}
7+
8+
export const Select = ({
9+
label,
10+
children,
11+
placeholder = undefined,
12+
description = undefined,
13+
}: Select) => (
14+
<label
15+
className="
16+
block
17+
w-full
18+
">
19+
<span
20+
className="
21+
font-medium
22+
text-md
23+
text-black-300
24+
">
25+
{label}
26+
</span>
27+
28+
<div className="relative">
29+
<select
30+
className="
31+
appearance-none
32+
block
33+
border
34+
border-black-200
35+
rounded-md
36+
h-9
37+
px-3
38+
pr-10
39+
mt-1.5
40+
text-md
41+
text-black-900
42+
w-full
43+
44+
focus:ring-1
45+
focus:ring-black-200
46+
focus:outline-none
47+
"
48+
placeholder={placeholder}>
49+
{children}
50+
</select>
51+
52+
<svg
53+
className="
54+
absolute
55+
right-4
56+
top-1/2
57+
-translate-y-1/2
58+
"
59+
width="11"
60+
height="7"
61+
viewBox="0 0 11 7">
62+
<path
63+
fillRule="evenodd"
64+
clipRule="evenodd"
65+
d="M0.292969 1.17683L1.00008 0.469727L5.64652 5.11617L10.293 0.469727L11.0001 1.17683L5.64652 6.53039L0.292969 1.17683Z"
66+
fill="#151928" />
67+
</svg>
68+
69+
</div>
70+
71+
{description &&
72+
<span
73+
className="text-sm text-black-300">{description}</span>}
74+
</label>
75+
)

app/components/Fields/index.ts

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import {Input} from './Input/Input'
2+
import {FieldButton} from './Button/Button'
3+
import {Select} from './Select/Select'
4+
5+
const Fields = {
6+
Button: FieldButton,
7+
Input,
8+
Select,
9+
}
10+
11+
export default Fields
+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
interface GuideStep {
2+
step: string;
3+
title: string;
4+
description: string;
5+
}
6+
7+
export const GuideStep = ({
8+
step,
9+
title,
10+
description,
11+
}: GuideStep) => (
12+
<div>
13+
<h2
14+
className="
15+
font-semibold
16+
text-lg
17+
">
18+
Step {step}:&nbsp;
19+
20+
<em
21+
className="
22+
23+
not-italic
24+
relative
25+
26+
after:absolute
27+
after:border-b
28+
after:border-blue-400
29+
after:-bottom-1
30+
after:left-0
31+
after:w-full
32+
">
33+
{title}
34+
</em>
35+
</h2>
36+
37+
<p
38+
className="
39+
leading-tight
40+
pt-3
41+
max-w-xs
42+
text-body
43+
text-black-300
44+
">
45+
{description}
46+
</p>
47+
</div>
48+
)

app/entry.client.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { hydrate } from "react-dom";
2+
import { RemixBrowser } from "remix";
3+
4+
hydrate(<RemixBrowser />, document);

app/entry.server.tsx

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { renderToString } from "react-dom/server";
2+
import { RemixServer } from "remix";
3+
import type { EntryContext } from "remix";
4+
5+
export default function handleRequest(
6+
request: Request,
7+
responseStatusCode: number,
8+
responseHeaders: Headers,
9+
remixContext: EntryContext
10+
) {
11+
const markup = renderToString(
12+
<RemixServer context={remixContext} url={request.url} />
13+
);
14+
15+
responseHeaders.set("Content-Type", "text/html");
16+
17+
return new Response("<!DOCTYPE html>" + markup, {
18+
status: responseStatusCode,
19+
headers: responseHeaders
20+
});
21+
}

app/images/logo-white.svg

+8
Loading

0 commit comments

Comments
 (0)