Skip to content

Commit 278da76

Browse files
committed
Public repo for FrontendMasters workshop website
0 parents  commit 278da76

86 files changed

Lines changed: 6164 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.gitignore‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.vercel
2+
.next
3+
node_modules

‎.vscode/settings.json‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"grammarly.selectors": [
3+
{
4+
"language": "mdx",
5+
"scheme": "file"
6+
}
7+
]
8+
}

‎components/Callout.tsx‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import React from "react";
2+
import LightBulbIcon from "@heroicons/react/solid/LightBulbIcon";
3+
import WarningIcon from "@heroicons/react/solid/ExclamationIcon";
4+
import ErrorIcon from "@heroicons/react/solid/ExclamationCircleIcon";
5+
import InformationCircleIcon from "@heroicons/react/solid/InformationCircleIcon";
6+
import { CheckCircleIcon } from "@heroicons/react/solid";
7+
8+
const themes = {
9+
info: {
10+
classes:
11+
"bg-blue-100 text-blue-800 dark:text-blue-300 dark:bg-blue-200 dark:bg-opacity-20",
12+
icon: <InformationCircleIcon className="w-5 h-5 mt-1" />,
13+
},
14+
idea: {
15+
classes:
16+
"bg-gray-100 text-gray-800 dark:text-gray-300 dark:bg-gray-200 dark:bg-opacity-20",
17+
icon: <LightBulbIcon className="w-5 h-5 mt-1" />,
18+
},
19+
error: {
20+
classes:
21+
"bg-red-200 text-red-900 dark:text-red-200 dark:bg-red-600 dark:bg-opacity-30",
22+
icon: <ErrorIcon className="w-5 h-5 mt-1" />,
23+
},
24+
default: {
25+
classes:
26+
"bg-orange-100 text-orange-800 dark:text-orange-300 dark:bg-orange-200 dark:bg-opacity-20",
27+
icon: <WarningIcon className="w-5 h-5 mt-1" />,
28+
},
29+
green: {
30+
classes:
31+
"bg-green-100 text-green-800 dark:text-green-300 dark:bg-green-200 dark:bg-opacity-20",
32+
icon: <CheckCircleIcon className="w-5 h-5 mt-1" />,
33+
},
34+
};
35+
36+
export default function Callout({ children, type = "default", icon }) {
37+
const theme = themes[type] || themes.default;
38+
39+
return (
40+
<div className={`${theme.classes} flex rounded-lg callout mt-6`}>
41+
<div
42+
className="py-2 pl-3 pr-2 text-xl select-none"
43+
style={{
44+
fontFamily:
45+
'"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
46+
}}
47+
>
48+
{icon || theme.icon}
49+
</div>
50+
<div className="py-2 pr-4">{children}</div>
51+
</div>
52+
);
53+
}

‎components/Features.tsx‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import {
2+
LightningBoltIcon,
3+
PuzzleIcon,
4+
CogIcon,
5+
} from "@heroicons/react/outline";
6+
7+
const features = [
8+
{
9+
name: "Design Patterns",
10+
icon: PuzzleIcon,
11+
},
12+
{
13+
name: "React Patterns",
14+
icon: () => <img src="/react.svg" height="20" width="20" />,
15+
},
16+
{
17+
name: "Rendering Patterns",
18+
icon: CogIcon,
19+
},
20+
{
21+
name: "Performance Patterns",
22+
icon: LightningBoltIcon,
23+
},
24+
];
25+
26+
function Features() {
27+
return (
28+
<>
29+
<div className="grid grid-cols-4 gap-3 my-12 sm:grid-cols-4">
30+
{features.map(({ icon: Icon, ...feature }, i) => (
31+
<div
32+
className="flex items-center space-x-4"
33+
key={feature.name.split(" ").join("-")}
34+
>
35+
<div>
36+
<Icon
37+
className="block w-8 h-8"
38+
style={{ height: 24, width: 24 }}
39+
aria-hidden="true"
40+
/>
41+
</div>
42+
<div>
43+
<div className="my-0 font-small dark:text-white">
44+
{feature.name}
45+
</div>
46+
</div>
47+
</div>
48+
))}
49+
</div>
50+
</>
51+
);
52+
}
53+
54+
export default Features;

‎components/StackBlitz.tsx‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export default function StackBlitz(props: {
2+
name: string;
3+
height?: number;
4+
view?: "preview" | "editor",
5+
openFile?: string;
6+
hideExplorer?: boolean;
7+
showDevtools?: boolean;
8+
}) {
9+
10+
return (
11+
<iframe
12+
src={`https://stackblitz.com/edit/${props.name}?embed=1&hideExplorer=${props.hideExplorer ? 1 : 0}&file=${props.openFile}&view=${props.view}&devToolsHeight=${props.showDevtools ? "50" : "0"}`}
13+
height={props.height || 600}
14+
style={{ width: "100%" }}
15+
/>
16+
)
17+
}

‎custom.css‎

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
.nextra-body.full {
2+
margin: 0 auto;
3+
}
4+
5+
code {
6+
@apply text-sm;
7+
}
8+
9+
.dark .invert-on-dark {
10+
filter: invert(1) brightness(1.8);
11+
}
12+
13+
.nextra-toc-meta {
14+
display: none;
15+
}
16+
17+
code {
18+
font-family: "Menlo", PT Mono,Consolas,Monaco,"Andale Mono","Ubuntu Mono",monospace !important;
19+
}
20+
21+
video {
22+
/* border: 2px solid #262626;
23+
border-radius: 10px; */
24+
width: 100%;
25+
margin: 2em 0;
26+
/* padding: 0 2em;
27+
background: black; */
28+
}
29+
30+
.dark p, .dark ol, .dark li {
31+
color: #e3e3e3;
32+
}
33+
34+
iframe {
35+
border-radius: 7px;
36+
margin: 2em 0;
37+
}
38+
39+
p > strong {
40+
color: #FF42A1;
41+
}
42+
43+
.nextra-sidebar-menu {
44+
box-shadow: none !important;
45+
}
46+
47+
.dark .nextra-sidebar-menu > div {
48+
background: black !important;
49+
}
50+
51+
.light .nextra-sidebar-menu > div {
52+
background: white !important;
53+
}
54+
55+
a > h1 {
56+
font-weight: 500;
57+
}

‎next-env.d.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

‎next.config.js‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const withNextra = require("nextra")({
2+
theme: "nextra-theme-docs",
3+
themeConfig: "./theme.config.js",
4+
unstable_flexsearch: true,
5+
unstable_staticImage: true,
6+
});
7+
8+
module.exports = withNextra({
9+
// reactStrictMode: true,
10+
experiments: {
11+
esmExternals: true,
12+
},
13+
async redirects() {
14+
return [
15+
{
16+
source: '/',
17+
destination: '/patterns',
18+
permanent: true,
19+
},
20+
]
21+
},
22+
});

‎package.json‎

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"name": "javascript-react-patterns",
3+
"version": "1.0.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next",
7+
"start": "next start",
8+
"build": "next build ",
9+
"lint": "next lint"
10+
},
11+
"dependencies": {
12+
"@heroicons/react": "1.0.5",
13+
"@react-aria/ssr": "3.1.2",
14+
"next": "12.1.0",
15+
"nextra": "2.0.0-alpha.50",
16+
"nextra-theme-docs": "2.0.0-alpha.53",
17+
"react": "17.0.2",
18+
"react-dom": "17.0.2"
19+
},
20+
"devDependencies": {
21+
"@types/node": "^18.7.13",
22+
"@types/react": "17.0.37",
23+
"autoprefixer": "10.2.6",
24+
"postcss": "8.3.5",
25+
"tailwindcss": "3.0.15",
26+
"typescript": "^4.8.2"
27+
}
28+
}

‎pages/.DS_Store‎

6 KB
Binary file not shown.

0 commit comments

Comments
 (0)