Skip to content

Commit

Permalink
Merge pull request #87 from JuniFruit/junifruit_frontend
Browse files Browse the repository at this point in the history
Junifruit frontend
  • Loading branch information
steph-koopmanschap authored May 30, 2023
2 parents 86ee342 + dbc7c08 commit 1d42ec0
Show file tree
Hide file tree
Showing 264 changed files with 7,241 additions and 4,659 deletions.
File renamed without changes.
File renamed without changes.
35 changes: 35 additions & 0 deletions frontend/nextjs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env*.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
File renamed without changes.
34 changes: 34 additions & 0 deletions frontend/nextjs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

## Getting Started

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file.

This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.

## Learn More

To learn more about Next.js, take a look at the following resources:

- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.

You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!

## Deploy on Vercel

The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.

Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
84 changes: 84 additions & 0 deletions frontend/nextjs/app/MetaHead.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
import Head from "next/head";

//Default Head to provide page metadata

export function MetaHead(props) {
const { title } = props;

const csrfToken = "";

return (
<div>
<Head>
<meta charSet="utf-8" />

<title>{title ? `${title} | JASMA` : "JASMA"}</title>

<meta
name="description"
content="JASMA - Just Another Social Media App"
/>
<meta
name="viewport"
content="width=device-width, initial-scale=1"
/>
<meta
name="theme-color"
content="#000000"
/>
<meta
name="author"
content="Steph Koopmanschap and others"
/>
<meta
name="csrf-token"
content={csrfToken}
></meta>

<meta
property="og:title"
content="Just Another Social Media App"
/>
<meta
property="og:type"
content="website"
/>
<meta
property="og:url"
content="https://jasma.vercel.app"
/>
<meta
property="og:description"
content="Just Another Social Media App"
/>
<meta
property="og:image"
content="image.png"
/>

<link
rel="icon"
href="/favicon.ico"
/>
<link
rel="icon"
href="/favicon.svg"
type="image/svg+xml"
></link>
<link
rel="apple-touch-icon"
href="/logo192.png"
/>

{/* <!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
--> */}
<link
rel="manifest"
href="/manifest.json"
/>
</Head>
</div>
);
}
27 changes: 14 additions & 13 deletions next/components/nav/Nav.js → frontend/nextjs/app/Nav.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faBell } from '@fortawesome/free-solid-svg-icons'
import Brand from "../brand/Brand";
import SearchBar from "../SearchBar";
import ThemeSwitch from "../ThemeSwitch";
import NavProfile from "../profile/NavProfile";
import DropDownBtn from "../DropDownBtn";
import NotificationList from '../NotificationList';
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faBell } from "@fortawesome/free-solid-svg-icons";

import Brand from "@/widgets/brand";
import { DropDownBtn } from "@/shared/ui";
import { ThemeSwitch } from "@/features/theme";
import UserWidgets from "@/widgets/user/index";
import NotificationList from "@/widgets/notification-list";
import { SearchInput } from "@/features/search";

const Nav = () => {
return (
Expand All @@ -15,20 +16,20 @@ const Nav = () => {
</div>

<div className="flex">
<SearchBar prevQuery="Search..." />
<SearchInput prevQuery="Search..." />
</div>

<div className="flex">
<DropDownBtn
style="flex flex-col hover:text-sky-400"
style="flex flex-col hover:text-sky-400"
dropDownStyle="flex flex-col p-2 m-1 w-1/2 bg-gray-900 place-self-end "
addIcon={false}
replacementIcon={<FontAwesomeIcon icon={faBell} />}
replacementIcon={<FontAwesomeIcon icon={faBell} />}
>
<NotificationList />
</DropDownBtn>
<NavProfile />
<div className='flex self-center'>
<UserWidgets.NavProfile />
<div className="flex self-center">
<ThemeSwitch />
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { useEffect, useRef } from "react";
import { useRecoilState } from "recoil";
import { ThemeProvider } from "styled-components";
import GlobalStyles from "../styles/GlobalStyles";
import Nav from "./nav/Nav";
import DefaultHead from "./DefaultHead";
import themes from "../styles/themes";
import themeState from "../state/themeState";
import Nav from "../Nav";
import { MetaHead } from "../MetaHead";
import { themeState, themes } from "@/entities/theme";
import GlobalStyles from "@/shared/styles/GlobalStyles";
import FooterMain from "@/widgets/footer";
import HeaderMain from "@/widgets/header";

export default function Layout({ children }) {
const [theme, setTheme] = useRecoilState(themeState);
Expand Down Expand Up @@ -51,7 +52,8 @@ export default function Layout({ children }) {
return (
<ThemeProvider theme={theme.styles}>
<GlobalStyles isLoaded={isLoaded.current} />
<DefaultHead />
<MetaHead />

<header>
<Nav
theme={theme}
Expand All @@ -60,8 +62,10 @@ export default function Layout({ children }) {
</header>

<main>
<HeaderMain />
{children}
</main>
<FooterMain />
</ThemeProvider>
);
}
Loading

0 comments on commit 1d42ec0

Please sign in to comment.