Added import sorting to prettier config
continuous-integration/drone/push Build is passing Details

main
Guus van Meerveld 2 years ago
parent 2b4b0d0a39
commit 53f63981c6
Signed by: Guusvanmeerveld
GPG Key ID: 2BA7D7912771966E

@ -1,9 +1,8 @@
import Link from "next/link";
import { FC } from "react";
import { format as formatTimeAgo } from "timeago.js";
import z from "zod";
import { format as formatTimeAgo } from "timeago.js";
import { FC } from "react";
import { RepositoryResponse } from "@models/git/responses";

@ -1,15 +1,14 @@
import z from "zod";
import { FC } from "react";
import Link from "next/link";
import { format as formatTimeAgo } from "timeago.js";
import z from "zod";
import Link from "next/link";
import styles from "./repositories.module.scss";
import multipleClassNames from "@utils/multipleClassNames";
import { FC } from "react";
import { RepositoryResponse } from "@models/git/responses";
import styles from "./repositories.module.scss";
import multipleClassNames from "@utils/multipleClassNames";
const FeaturedRepositories: FC<{
repositories: z.infer<typeof RepositoryResponse>[];

@ -1,12 +1,12 @@
import { FC } from "react";
import Link from "next/link";
import multipleClassNames from "@utils/multipleClassNames";
import { giteaServerUrl, giteaUsername } from "@utils/config";
import styles from "./footer.module.scss";
import { FC } from "react";
import { giteaServerUrl, giteaUsername } from "@utils/config";
import multipleClassNames from "@utils/multipleClassNames";
const Footer: FC = () => {
return (
<footer className={multipleClassNames("container", styles.main)}>

@ -1,14 +1,14 @@
import { useRouter } from "next/router";
import axios from "axios";
import { FC, FormEvent, useCallback, useState } from "react";
import axios from "axios";
import { LoginCredentials } from "@models/login";
import { Response } from "@models/response";
import { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
import { parseUserInputError } from "@utils/errors";
import { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
const LoginForm: FC = () => {
const [username, setUsername] = useState("");
@ -87,7 +87,7 @@ const LoginForm: FC = () => {
<i className="form-icon" /> Remember me
</label>
{error !== null && (
<div className="toast toast-error">
<div className="toast toast-error mb-2">
<button
className="btn btn-clear float-right"
onClick={() => setError(null)}

@ -1,14 +1,14 @@
import { FC } from "react";
import Link from "next/link";
import styles from "./post.module.scss";
import { FC } from "react";
import { Post, User } from "@prisma/client";
import multipleClassNames from "@utils/multipleClassNames";
import styles from "./post.module.scss";
const Post: FC<{
const PostsPage: FC<{
post: Post & {
author: User;
};
@ -51,4 +51,4 @@ const Post: FC<{
);
};
export default Post;
export default PostsPage;

@ -1,14 +1,14 @@
import axios from "axios";
import { useRouter } from "next/router";
import { FC, FormEvent, useCallback, useState } from "react";
import { useRouter } from "next/router";
import axios from "axios";
import { SignupCredentials } from "@models/signup";
import { Response } from "@models/response";
import { SignupCredentials } from "@models/signup";
import { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
import { parseUserInputError } from "@utils/errors";
import { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
const SignupForm: FC = () => {
const [email, setEmail] = useState("");

@ -1,9 +1,9 @@
import { FC, useEffect, useState } from "react";
import { useTheme } from "next-themes";
import styles from "./themeChanger.module.scss";
import { FC, useEffect, useState } from "react";
const ThemeChanger: FC = () => {
const [mounted, setMounted] = useState(false);
const { theme, setTheme } = useTheme();

@ -1,14 +1,15 @@
import { FC } from "react";
import Image from "next/image";
import z from "zod";
import Image from "next/image";
import styles from "./user.module.scss";
import { FC } from "react";
import { UserResponse } from "@models/git/responses";
import { giteaServerUrl } from "@utils/config";
import multipleClassNames from "@utils/multipleClassNames";
import styles from "./user.module.scss";
const User: FC<{ isAvailable: boolean; user: z.infer<typeof UserResponse> }> =
({ isAvailable, user }) => {
return (

@ -1,6 +1,6 @@
$margin: 1rem;
.main {
margin-top: $margin;
margin-bottom: $margin;
}
margin-top: $margin;
margin-bottom: $margin;
}

@ -1,7 +1,7 @@
.body {
padding: 1rem;
padding: 1rem;
}
.info {
text-align: right;
}
text-align: right;
}

@ -1,7 +1,7 @@
.card {
border: 0;
border: 0;
}
.main {
margin-bottom: 3rem;
}
margin-bottom: 3rem;
}

@ -1,7 +1,7 @@
.main {
position: absolute;
top: 1rem;
right: 1rem;
position: absolute;
top: 1rem;
right: 1rem;
cursor: pointer;
}
cursor: pointer;
}

@ -1,18 +1,17 @@
.main {
padding-top: 10rem;
margin-bottom: 2rem;
padding-top: 10rem;
margin-bottom: 2rem;
}
.avatar {
border-radius: 5px;
border-radius: 5px;
}
.avatarContainer {
margin-right: 2rem;
margin-right: 2rem;
}
.avatarCol {
display: flex;
justify-content: right;
}
display: flex;
justify-content: right;
}

@ -1,8 +1,8 @@
.main {
height: 100vh;
margin-bottom: 1rem;
height: 100vh;
margin-bottom: 1rem;
display: flex;
justify-content: center;
align-items: center;
}
display: flex;
justify-content: center;
align-items: center;
}

@ -1,11 +1,11 @@
import { NextPage } from "next";
import { useRouter } from "next/router";
import Layout from "@components/Layout";
import styles from "./404.module.scss";
import multipleClassNames from "@utils/multipleClassNames";
import styles from "./404.module.scss";
import Layout from "@components/Layout";
const NotFound: NextPage = () => {
const router = useRouter();

@ -1,14 +1,12 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import "@styles/globals.scss";
import SEO from "../next-seo.config";
import { DefaultSeo } from "next-seo";
import { ThemeProvider } from "next-themes";
import type { AppProps } from "next/app";
import SEO from "../next-seo.config";
import "@styles/globals.scss";
const queryClient = new QueryClient();
const App = ({ Component, pageProps }: AppProps): JSX.Element => (

@ -1,3 +1,3 @@
.body {
padding: 10rem 0;
}
padding: 10rem 0;
}

@ -1,14 +1,14 @@
import { NextPage } from "next";
import { NextSeo } from "next-seo";
import { Post, User } from "@prisma/client";
import styles from "./admin.module.scss";
import Layout from "@components/Layout";
import { Post, User } from "@prisma/client";
import { withSessionSsr } from "@utils/session";
import prisma from "@utils/prisma";
import { withSessionSsr } from "@utils/session";
import styles from "./admin.module.scss";
import Layout from "@components/Layout";
const AdminPage: NextPage<{
user: User;

@ -1,11 +1,11 @@
import { NextApiHandler } from "next";
import { Post } from "@models/post";
import { Response } from "@models/response";
import { methodNotAllowed, unauthorized } from "@utils/errors";
import { withIronSession } from "@utils/session";
import prisma from "@utils/prisma";
import { Response } from "@models/response";
import { Post } from "@models/post";
import { withIronSession } from "@utils/session";
const handle: NextApiHandler<Response> = async (req, res) => {
if (req.method?.toUpperCase() != "POST") {

@ -4,9 +4,9 @@ import { NextApiHandler } from "next";
import { LoginCredentials } from "@models/login";
import { Response } from "@models/response";
import { withIronSession } from "@utils/session";
import { methodNotAllowed, unauthorized } from "@utils/errors";
import prisma from "@utils/prisma";
import { withIronSession } from "@utils/session";
const handle: NextApiHandler<Response> = async (req, res) => {
if (req.method?.toUpperCase() !== "POST") {

@ -1,9 +1,10 @@
import { NextApiHandler } from "next";
import { withIronSession } from "@utils/session";
import { methodNotAllowed, unauthorized } from "@utils/errors";
import { Response } from "@models/response";
import { methodNotAllowed, unauthorized } from "@utils/errors";
import { withIronSession } from "@utils/session";
const handle: NextApiHandler<Response> = (req, res) => {
if (req.method?.toUpperCase() != "GET") {
res.status(405).json(methodNotAllowed);

@ -1,7 +1,7 @@
import { Response } from "@models/response";
import { NextApiHandler } from "next";
import { Response } from "@models/response";
import { registrationIsEnabled } from "@utils/config";
import { methodNotAllowed } from "@utils/errors";

@ -1,15 +1,13 @@
import bcrypt from "bcrypt";
import { NextApiHandler } from "next";
import prisma from "@utils/prisma";
import { SignupCredentials } from "@models/signup";
import { Response } from "@models/response";
import { SignupCredentials } from "@models/signup";
import { withIronSession } from "@utils/session";
import { methodNotAllowed } from "@utils/errors";
import { registrationIsEnabled, saltRoundsForPassword } from "@utils/config";
import { methodNotAllowed } from "@utils/errors";
import prisma from "@utils/prisma";
import { withIronSession } from "@utils/session";
const handle: NextApiHandler<Response> = async (req, res) => {
if (!registrationIsEnabled) {

@ -1,3 +1,3 @@
.body {
padding: 10rem 0;
}
padding: 10rem 0;
}

@ -1,14 +1,14 @@
import { NextSeo } from "next-seo";
import { GetStaticPaths, GetStaticProps, NextPage } from "next";
import { NextSeo } from "next-seo";
import { Post, User } from "@prisma/client";
import styles from "./[id].module.scss";
import Layout from "@components/Layout";
import Tags from "@components/Tags";
import { Post, User } from "@prisma/client";
import prisma from "@utils/prisma";
import styles from "./[id].module.scss";
import Layout from "@components/Layout";
import Tags from "@components/Tags";
const PostPage: NextPage<{
post: Post & {

@ -1,10 +1,9 @@
.body {
padding: 10rem 1rem;
padding: 10rem 1rem;
@media (max-width: 840px) {
padding: 2rem 1rem;
}
@media (max-width: 840px) {
padding: 2rem 1rem;
}
min-height: 100vh;
}
min-height: 100vh;
}

@ -1,16 +1,15 @@
import { GetStaticProps, NextPage } from "next";
import { NextSeo } from "next-seo";
import { Post, User } from "@prisma/client";
import styles from "./blog.module.scss";
import Layout from "@components/Layout";
import { Post, User } from "@prisma/client";
import prisma from "@utils/prisma";
import Layout from "@components/Layout";
import PostComponent from "@components/Post";
import styles from "./blog.module.scss";
const Blog: NextPage<{
posts: (Post & {
author: User;

@ -1,4 +1,4 @@
.body {
height: 100vh;
padding: 10rem 0;
}
height: 100vh;
padding: 10rem 0;
}

@ -1,23 +1,23 @@
import axios from "axios";
import { FormEvent, useCallback, useState } from "react";
import { NextPage } from "next";
import { NextSeo } from "next-seo";
import { useRouter } from "next/router";
import { User } from "@prisma/client";
import styles from "./new.module.scss";
import Layout from "@components/Layout";
import { FormEvent, useCallback, useState } from "react";
import { withSessionSsr } from "@utils/session";
import { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
import { parseUserInputError } from "@utils/errors";
import axios from "axios";
import { User } from "@prisma/client";
import { Post } from "@models/post";
import { Response } from "@models/response";
import styles from "./new.module.scss";
import { parseUserInputError } from "@utils/errors";
import { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
import { withSessionSsr } from "@utils/session";
import Layout from "@components/Layout";
const NewPostPage: NextPage<{ user: User }> = ({ user }) => {
const [title, setTitle] = useState("");

@ -1,22 +1,20 @@
import z from "zod";
import { NextSeo } from "next-seo";
import { GetStaticProps, InferGetStaticPropsType, NextPage } from "next";
import User from "@components/User";
import Layout from "@components/Layout";
import FeaturedRepositories from "@components/FeaturedRepositories";
import BestRepository from "@components/BestRepository";
import { NextSeo } from "next-seo";
import z from "zod";
import { RepositoryResponse } from "@models/git/responses";
import { giteaUsername } from "@utils/config";
import {
fetchAvailability,
fetchRepositories,
fetchUser
} from "@utils/git/fetch";
import { giteaUsername } from "@utils/config";
import BestRepository from "@components/BestRepository";
import FeaturedRepositories from "@components/FeaturedRepositories";
import Layout from "@components/Layout";
import User from "@components/User";
export const getStaticProps: GetStaticProps = async () => {
const isAvailable = await fetchAvailability();

@ -1,21 +1,21 @@
.body {
height: 100vh;
padding: 10rem 0;
height: 100vh;
padding: 10rem 0;
}
.title {
text-align: center;
text-align: center;
}
.divider {
margin: 0 1rem;
margin: 0 1rem;
}
.loginButton,
.signupButton {
width: 100%;
width: 100%;
}
.signupButton {
margin-top: .5rem;
}
margin-top: 0.5rem;
}

@ -1,19 +1,16 @@
import z from "zod";
import axios from "axios";
import { useQuery } from "@tanstack/react-query";
import { NextPage } from "next";
import { NextSeo } from "next-seo";
import z from "zod";
import Layout from "@components/Layout";
import styles from "./login.module.scss";
import multipleClassNames from "@utils/multipleClassNames";
import { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
import axios from "axios";
import styles from "./login.module.scss";
import { parseAxiosError, parseAxiosResponse } from "@utils/fetch";
import multipleClassNames from "@utils/multipleClassNames";
import Layout from "@components/Layout";
import LoginForm from "@components/LoginForm";
import SignupForm from "@components/SignupForm";

@ -1,108 +1,104 @@
[data-theme="dark"] {
body {
background-color: $bg-dark;
color: $text-primary;
}
.empty {
background-color: $bg-dark-secondary;
color: $text-primary;
}
.card {
background-color: $bg-dark;
}
.form-input,
.form-icon {
background-color: $bg-dark-secondary !important;
color: $text-primary;
border-color: lighten($bg-dark-secondary, 10%);
}
.divider-vert {
&::before {
border-color: lighten($bg-dark-secondary, 10%);
}
&[data-content]::after {
background-color: $bg-dark;
}
}
.bg-gray {
background-color: $bg-dark-secondary !important;
}
.chip {
background-color: lighten($bg-dark-secondary, 10%);
}
.divider {
border-color: $bg-dark-secondary;
}
.table {
td,
th {
border-color: lighten($bg-dark-secondary, 10%);
}
}
.table tbody tr.active,
.table.table-striped tbody tr.active {
background: $bg-dark-secondary
}
a:hover {
color: $primary-color-dark;
}
a {
color: $primary-color;
}
.text-primary {
color: $primary-color !important;
}
.bg-primary {
background-color: $primary-color !important;
}
.btn {
background-color: $bg-dark-secondary;
color: $primary-color;
border-color: $primary-color;
&:hover {
border-color: $primary-color;
}
&:focus {
border-color: $primary-color;
}
}
.btn-primary {
background-color: $primary-color;
border-color: $primary-color;
color: $text-primary;
&:hover {
background-color: $primary-color-dark;
border-color: $primary-color-dark;
}
&:focus {
background-color: $primary-color-dark;
border-color: $primary-color-dark;
}
}
}
body {
background-color: $bg-dark;
color: $text-primary;
}
.empty {
background-color: $bg-dark-secondary;
color: $text-primary;
}
.card {
background-color: $bg-dark;
}
.form-input,
.form-icon {
background-color: $bg-dark-secondary !important;
color: $text-primary;
border-color: lighten($bg-dark-secondary, 10%);
}
.divider-vert {
&::before {
border-color: lighten($bg-dark-secondary, 10%);
}
&[data-content]::after {
background-color: $bg-dark;
}
}
.bg-gray {
background-color: $bg-dark-secondary !important;
}
.chip {
background-color: lighten($bg-dark-secondary, 10%);
}
.divider {
border-color: $bg-dark-secondary;
}
.table {
td,
th {
border-color: lighten($bg-dark-secondary, 10%);
}
}
.table tbody tr.active,
.table.table-striped tbody tr.active {
background: $bg-dark-secondary;
}
a:hover {
color: $primary-color-dark;
}
a {
color: $primary-color;
}
.text-primary {
color: $primary-color !important;
}
.bg-primary {
background-color: $primary-color !important;
}
.btn {
background-color: $bg-dark-secondary;
color: $primary-color;
border-color: $primary-color;
&:hover {
border-color: $primary-color;
}
&:focus {
border-color: $primary-color;
}
}
.btn-primary {
background-color: $primary-color;
border-color: $primary-color;
color: $text-primary;
&:hover {
background-color: $primary-color-dark;
border-color: $primary-color-dark;
}
&:focus {
background-color: $primary-color-dark;
border-color: $primary-color-dark;
}
}
}

@ -10,4 +10,4 @@ $bg-dark: $dark-color;
$bg-dark-secondary: $dark-color-secondary;
$text-primary: $light-color;
$text-secondary: darken($light-color, 10%);
$text-secondary: darken($light-color, 10%);

@ -6,5 +6,5 @@
@import "dark";
p {
line-height: 1.25rem;
}
line-height: 1.25rem;
}

@ -1,7 +1,6 @@
import axios from "axios";
import z from "zod";
import createConfigCatClient from "@utils/createConfigCatClient";
import axios from "axios";
import {
RepositoryResponse,
@ -10,6 +9,7 @@ import {
} from "@models/git/responses";
import { giteaServerUrl } from "@utils/config";
import createConfigCatClient from "@utils/createConfigCatClient";
const apiUrl = `https://${giteaServerUrl}/api/v1`;

@ -5,10 +5,10 @@ import {
NextApiHandler
} from "next";
import { User } from "@prisma/client";
import { sessionOptions } from "./config";
import { User } from "@prisma/client";
export const withIronSession = (handler: NextApiHandler) =>
withIronSessionApiRoute(handler, sessionOptions);

Loading…
Cancel
Save