Skip to content

Commit

Permalink
feat: Adding Portal landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
RabeeAbuBaker committed Nov 2, 2023
1 parent 042cf69 commit 12259c6
Show file tree
Hide file tree
Showing 6 changed files with 166 additions and 11 deletions.
23 changes: 19 additions & 4 deletions app/routes/_index/route.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
import { LoaderFunction } from "@remix-run/node"
import { redirectToUserAccount, requireUser } from "~/utils/user.server"
import { LoaderFunction, MetaFunction, redirect } from "@remix-run/node"
import LandingView from "~/routes/_index/view"
import { getUserProfile } from "~/utils/user.server"

export const meta: MetaFunction = () => {
return {
title: `Grove Portal`,
}
}

export const loader: LoaderFunction = async ({ request }) => {
const user = await requireUser(request)
const user = await getUserProfile(request)

if (user) {
return redirect("/account")
}

return null
}

return redirectToUserAccount(user)
export default function Landing() {
return <LandingView />
}
131 changes: 131 additions & 0 deletions app/routes/_index/view.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
import {
Anchor,
Button,
Flex,
Grid,
Group,
MediaQuery,
Stack,
Title,
} from "@pokt-foundation/pocket-blocks"
import { Link } from "@remix-run/react"
import PortalLoader from "~/components/PortalLoader"

export default function LandingView() {
return (
<Grid gutter={0} h="100vh">
<MediaQuery smallerThan="sm" styles={{ display: "none" }}>
<Grid.Col span={7}>
<Flex
align="center"
bg="green"
h="100vh"
justify="center"
p="xl"
pos="relative"
>
<img
alt="Grove logo"
loading="lazy"
src="/grove-logo.svg"
style={{
width: "75px",
position: "absolute",
left: "22px",
top: "28px",
}}
></img>
<PortalLoader size="lg" />
</Flex>
</Grid.Col>
</MediaQuery>
<Grid.Col lg={5} md={5} sm={5} xs={12}>
<Flex direction="column" h="100%" justify="center">
<Stack justify="center" px="xl" spacing={55} style={{ flexGrow: 1 }}>
<Title align="center" order={2}>
Get started
</Title>
<Grid justify="center">
<Grid.Col lg={4} md={6} sm={12}>
<Button fullWidth component={Link} to="/api/auth/auth0">
Log in
</Button>
</Grid.Col>
<Grid.Col lg={4} md={6} sm={12}>
<Button fullWidth component={Link} to="/api/auth/auth0?signup=true">
Sign up
</Button>
</Grid.Col>
</Grid>
</Stack>
<Stack align="center" mb="xl" spacing="xl">
<img
alt="Grove logo"
loading="lazy"
src="/grove/grove-logo-icon-green.svg"
style={{
width: "107px",
}}
></img>
<Group>
<Anchor
href="https://www.grove.city"
rel="noreferrer"
target="_blank"
variant="text"
>
About
</Anchor>
<Anchor
href="https://docs.grove.city/"
rel="noreferrer"
target="_blank"
variant="text"
>
Docs
</Anchor>
<Anchor
href="https://www.grove.city/pricing"
rel="noreferrer"
target="_blank"
variant="text"
>
Pricing
</Anchor>
<Anchor
href="https://www.grove.city/enterprise"
rel="noreferrer"
target="_blank"
variant="text"
>
Enterprise
</Anchor>
</Group>
<Group>
<Anchor
c="dimmed"
fz="xs"
href="https://www.grove.city/terms"
rel="noreferrer"
target="_blank"
variant="text"
>
Terms of use
</Anchor>
<Anchor
c="dimmed"
fz="xs"
href="https://www.grove.city/privacy"
rel="noreferrer"
target="_blank"
variant="text"
>
Privacy Policy
</Anchor>
</Group>
</Stack>
</Flex>
</Grid.Col>
</Grid>
)
}
7 changes: 2 additions & 5 deletions app/routes/_login.email-verification/route.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Card, Title, Text, Box, Grid } from "@pokt-foundation/pocket-blocks"
import { ActionFunction, LoaderFunction, MetaFunction, redirect } from "@remix-run/node"
import Rive from "@rive-app/react-canvas"
import PortalLoader from "~/components/PortalLoader"
import { authenticator } from "~/utils/auth.server"
import { seo_title_append } from "~/utils/seo"

Expand Down Expand Up @@ -66,10 +66,7 @@ export default function EmailVerification() {
margin: "0 auto",
}}
></img>
<Rive
src="/rive/portal-loader.riv"
style={{ width: "180px", height: "180px", margin: "0 auto" }}
/>
<PortalLoader />
<Title mb="md" order={3}>
Verify Your Email
</Title>
Expand Down
3 changes: 1 addition & 2 deletions app/utils/user.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ export enum Permissions {
}

export const requireUser = async (request: Request, defaultRedirect = "/") => {
const url = new URL(request.url)
const user = await authenticator.isAuthenticated(request)

if (!user) {
throw redirect("/api/auth/auth0")
throw redirect("/")
}

if (!user.user) {
Expand Down
13 changes: 13 additions & 0 deletions public/grove/grove-logo-icon-green.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/solar-punk-city-2.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 12259c6

Please sign in to comment.