Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.0 #67

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft

4.0 #67

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 0 additions & 4 deletions .babelrc

This file was deleted.

10 changes: 10 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": [
"@remix-run/eslint-config",
"@remix-run/eslint-config/node",
"prettier"
],
"ignorePatterns": ["node_modules", "build", ".cache"],
"plugins": ["remix"],
"rules": {}
}
29 changes: 0 additions & 29 deletions .forestry/front_matter/templates/blog-post.yml

This file was deleted.

52 changes: 0 additions & 52 deletions .forestry/settings.yml

This file was deleted.

1 change: 0 additions & 1 deletion .forestry/snippets/youtube.snippet

This file was deleted.

3 changes: 0 additions & 3 deletions .gitattributes

This file was deleted.

17 changes: 7 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
node_modules

/public
/node_modules
/.cache
/build
/public/build
.env
!.env.template

/functions
/resources
app/styles/app.css
.DS_Store

/dist
# Local Netlify folder
.netlify
scripts/cache.json
yarn-error.log
Empty file removed .hugo_build.lock
Empty file.
1 change: 1 addition & 0 deletions .node-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
17.9.1
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

15 changes: 0 additions & 15 deletions .postcssrc

This file was deleted.

5 changes: 0 additions & 5 deletions .prettierrc

This file was deleted.

6 changes: 0 additions & 6 deletions .vscode/extensions.json

This file was deleted.

13 changes: 0 additions & 13 deletions .vscode/settings.json

This file was deleted.

7 changes: 0 additions & 7 deletions LICENSE

This file was deleted.

70 changes: 0 additions & 70 deletions README.md

This file was deleted.

17 changes: 17 additions & 0 deletions app/components/ExitPreview.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React from "react";

export default function ExitPreview() {
return (
<div className="pointer-events-none fixed inset-0 flex h-screen w-screen items-end justify-center">
<form
className="pointer-events-auto"
action="/resource/preview"
method="POST"
>
<button className="bg-black p-4 font-bold text-white" type="submit">
Exit Preview Mode
</button>
</form>
</div>
);
}
14 changes: 14 additions & 0 deletions app/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Logo from '~/components/Logo'

export default function Footer() {
return (
<header className="border-t border-gray-100 dark:border-gray-900">
<div className="container mx-auto flex items-center justify-between p-4 lg:px-12">
<Logo />
<div className="flex flex-1 flex-col items-end justify-end gap-2 text-sm md:flex-row md:items-center md:gap-5">
<a href="/studio">&copy; {new Date().getFullYear()} Veklabs</a>
</div>
</div>
</header>
)
}
13 changes: 13 additions & 0 deletions app/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import ThemeToggle from '~/components/ThemeToggle'
import Logo from '~/components/Logo'

export default function Header() {
return (
<header className="sticky top-0 border-b border-gray-100 dark:border-gray-900">
<div className="container mx-auto flex items-center justify-between p-4 lg:px-12">
<Logo />
<ThemeToggle />
</div>
</header>
)
}
16 changes: 16 additions & 0 deletions app/components/Layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import type { PropsWithChildren } from "react";

import Footer from "~/components/Footer";
import Header from "~/components/Header";

export default function Layout(props: PropsWithChildren) {
const { children } = props;

return (
<>
<Header />
<div className="container mx-auto min-h-full p-4 lg:p-12">{children}</div>
<Footer />
</>
);
}
53 changes: 53 additions & 0 deletions app/components/LikeDislike.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import { useFetcher, useLocation } from '@remix-run/react'
import { ThumbsDown, ThumbsUp } from 'lucide-react'

type LikeDislikeProps = {
id: string
likes: number
dislikes: number
}

export default function LikeDislike(props: LikeDislikeProps) {
const { id } = props
const fetcher = useFetcher()
const location = useLocation()

// Use fresh data returned from the ActionFunction, if a mutation has just finished
const likes = fetcher.type === 'done' ? fetcher.data.likes : props.likes
const dislikes =
fetcher.type === 'done' ? fetcher.data.dislikes : props.dislikes

return (
<fetcher.Form
action={location.pathname}
className="flex items-center justify-center gap-4 bg-black text-white"
method="post"
>
<input name="id" type="hidden" value={id} />
<button
name="action"
type="submit"
value="LIKE"
disabled={fetcher.state !== 'idle'}
className="flex items-center gap-2 bg-black p-4 transition-all duration-100 ease-in-out hover:bg-cyan-400 hover:text-black disabled:opacity-50"
title="Like"
>
<span className="text-xs font-bold">{likes}</span>
<ThumbsUp />
<span className="sr-only">Like</span>
</button>
<button
name="action"
type="submit"
value="DISLIKE"
disabled={fetcher.state !== 'idle'}
className="flex items-center gap-2 bg-black p-4 transition-all duration-100 ease-in-out hover:bg-cyan-400 hover:text-black disabled:opacity-50"
title="Dislike"
>
<ThumbsDown />
<span className="text-xs font-bold">{dislikes}</span>
<span className="sr-only">Dislike</span>
</button>
</fetcher.Form>
)
}
14 changes: 14 additions & 0 deletions app/components/Logo.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { Link } from "@remix-run/react";
import { useRouteData } from "remix-utils";

import type { HomeDocument } from "~/types/home";

export default function Logo() {
const { home } = useRouteData(`root`) as { home: HomeDocument };

return (
<p className="text-lg font-bold tracking-tighter text-black dark:text-white lg:text-2xl">
<Link to="/">{home.siteTitle}</Link>
</p>
);
}