Skip to content

Commit

Permalink
Merge pull request #52 from Till-B/Folder-Structure
Browse files Browse the repository at this point in the history
Folder Structure
  • Loading branch information
antonykamp authored Apr 15, 2021
2 parents 6068bdf + cf0e014 commit f13d282
Show file tree
Hide file tree
Showing 59 changed files with 63 additions and 90 deletions.
2 changes: 1 addition & 1 deletion app/auth/components/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Form, FORM_ERROR } from "app/core/components/Form"
import login from "app/auth/mutations/login"
import { Login } from "app/auth/validations"
import { Flex, Heading, Button, useDisclosure, Box } from "@chakra-ui/react"
import ForgotPasswordPage from "app/auth/pages/forgot-password"
import ForgotPasswordPage from "app/auth/components/forgot-password"
import { appLogger as log } from "app/lib/logger"

type LoginFormProps = {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BlitzPage, useMutation } from "blitz"
import Layout from "app/core/layouts/Layout"
import { LabeledTextField } from "app/core/components/LabeledTextField"
import { Form, FORM_ERROR } from "app/core/components/Form"
import { ForgotPassword } from "app/auth/validations"
Expand Down Expand Up @@ -64,6 +63,5 @@ const ForgotPasswordPage: BlitzPage = () => {
}

ForgotPasswordPage.redirectAuthenticatedTo = "/"
ForgotPasswordPage.getLayout = (page) => <Layout title="Forgot Your Password?">{page}</Layout>

export default ForgotPasswordPage
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Stack, HStack, Text, Circle } from "@chakra-ui/react"
import { InfoIcon } from "@chakra-ui/icons"
import { Message } from "app/queries/getChatsWithLastMessage"
import { Message } from "app/chats/queries/getChatsWithLastMessage"
import { Link as BlitzLink } from "blitz"

interface ChatPreviewProps {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
22 changes: 0 additions & 22 deletions app/core/layouts/Layout.tsx

This file was deleted.

File renamed without changes.
2 changes: 1 addition & 1 deletion app/components/layout.tsx → app/core/layouts/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import { AuthenticationError, Head, useMutation, useQuery, useRouter, Image } fr
import logout from "app/auth/mutations/logout"
import { AiFillGithub } from "react-icons/ai"
import { useMediaQuery } from "react-responsive"
import { ChangePassword } from "./changePasswordModal"
import { ChangePassword } from "../../auth/components/changePasswordModal"
import { LoginForm } from "app/auth/components/LoginForm"
import { SignupForm } from "app/auth/components/SignupForm"
import { Link as BlitzLink } from "blitz"
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ import {
ListItem,
} from "@chakra-ui/react"
import { useMediaQuery } from "react-responsive"
import OwnedList from "../LandingPage/frontPageOwnedList"
import PublicList from "../LandingPage/frontPagePublicList"
import Chat from "../LandingPage/frontPageChat"
import OwnedList from "./frontPageOwnedList"
import PublicList from "./frontPagePublicList"
import Chat from "./frontPageChat"
import { Image } from "blitz"
export default function FrontPage() {
const isMobile = useMediaQuery({ query: `(max-width: 850px)` })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ import {
useToast,
Box,
} from "@chakra-ui/react"
import AdminMessage from "app/components/chats/adminMessage"
import OwnMessage from "app/components/chats/ownMessage"
import StrangeMessage from "app/components/chats/strangeMessage"
import Layout from "app/components/layout"
import AdminMessage from "app/chats/components/adminMessage"
import OwnMessage from "app/chats/components/ownMessage"
import StrangeMessage from "app/chats/components/strangeMessage"
import Layout from "app/core/layouts/layout"
import { useQuery, useParam, useMutation } from "blitz"
import { Form, Field } from "react-final-form"
import { FORM_ERROR } from "final-form"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ import {
} from "@chakra-ui/react"
import { EditIcon, ChatIcon, InfoIcon } from "@chakra-ui/icons"
import { useMutation, useQuery, useRouter } from "blitz"
import renewList from "../../mutations/renewList"
import EditLists from "../editList"
import RemoveList from "../removeListModal"
import getChatByParticipants from "app/queries/getChatByParticipants"
import renewList from "../../lists/mutations/renewList"
import EditLists from "../../lists/components/editList"
import RemoveList from "../../lists/components/removeListModal"
import { BsArchive } from "react-icons/bs"
import archiveList from "../../mutations/archiveList"
import BrandBadge from "../BrandBadge"
import archiveList from "../../lists/mutations/archiveList"
import BrandBadge from "../../lists/components/BrandBadge"

interface OwnedListProps {
marketName: String
Expand Down
2 changes: 1 addition & 1 deletion app/lib/position.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useToast } from "@chakra-ui/react"
import updatePosition from "app/mutations/updatePoisition"
import updatePosition from "app/core/mutations/updatePoisition"
import { useMutation, useQuery } from "blitz"
import { useEffect, useState } from "react"

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import { ChatIcon, InfoIcon } from "@chakra-ui/icons"
import { useMutation, useQuery, useRouter } from "blitz"
import doneList from "../mutations/doneList"
import renewList from "../mutations/renewList"
import createAdminMessage from "app/mutations/createAdminMessage"
import getChatByParticipants from "app/queries/getChatByParticipants"
import createAdminMessage from "app/chats/mutations/createAdminMessage"
import getChatByParticipants from "app/chats/queries/getChatByParticipants"
import { BiShoppingBag, BiUserCircle, BiStore } from "react-icons/bi"
import { Link as BlitzLink } from "blitz"
import { getDistanceString, useCurrentPosition } from "app/lib/position"
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import {
import { EditIcon, ChatIcon, InfoIcon } from "@chakra-ui/icons"
import { useMutation, useQuery, useRouter } from "blitz"
import renewList from "../mutations/renewList"
import EditLists from "../components/editList"
import RemoveList from "../components/removeListModal"
import getChatByParticipants from "app/queries/getChatByParticipants"
import EditLists from "./editList"
import RemoveList from "./removeListModal"
import getChatByParticipants from "app/chats/queries/getChatByParticipants"
import { BsArchive } from "react-icons/bs"
import archiveList from "../mutations/archiveList"
import BrandBadge from "./BrandBadge"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ import { useMutation, useQuery } from "blitz"
import acceptList from "../mutations/acceptList"
import { useState } from "react"
import { BiShoppingBag, BiUserCircle, BiStore } from "react-icons/bi"
import createChat from "../mutations/createChat"
import createAdminMessage from "../mutations/createAdminMessage"
import getChatByParticipants from "../queries/getChatByParticipants"
import createChat from "../../chats/mutations/createChat"
import createAdminMessage from "../../chats/mutations/createAdminMessage"
import getChatByParticipants from "../../chats/queries/getChatByParticipants"
import { getDistanceString } from "app/lib/position"
import { appLogger as log } from "app/lib/logger"

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion app/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { ErrorBoundary } from "react-error-boundary"
import { queryCache } from "react-query"
import LoginForm from "app/auth/components/LoginForm"
import { ChakraProvider, extendTheme, shadow } from "@chakra-ui/react"
import Loading from "../components/loading"
import Loading from "../core/components/loading"

const theme = extendTheme({
colors: {
Expand Down
10 changes: 5 additions & 5 deletions app/pages/activeLists.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Flex, Heading, Text, Wrap, WrapItem } from "@chakra-ui/react"
import { Head, useQuery } from "blitz"
import Layout from "../components/layout"
import getPosition from "../queries/getPositionOfUser"
import getActiveLists from "../queries/getActiveLists"
import AcceptedList from "../components/acceptedList"
import Layout from "../core/layouts/layout"
import getPosition from "../core/queries/getPositionOfUser"
import getActiveLists from "../lists/queries/getActiveLists"
import AcceptedList from "../lists/components/acceptedList"
import { getDistanceByHaversine } from "../lib/position"
import checkIfUnreadMessage from "app/queries/checkIfUnreadMessages"
import checkIfUnreadMessage from "app/chats/queries/checkIfUnreadMessages"

export default function ActiveLists() {
const [activeList, activeListsExtras] = useQuery(getActiveLists, null, { refetchInterval: 2000 })
Expand Down
8 changes: 4 additions & 4 deletions app/pages/archivedLists.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Flex, Heading, Text, Wrap, WrapItem } from "@chakra-ui/react"
import Layout from "../components/layout"
import OwnedList from "../components/ownedList"
import getArchivedLists from "../queries/getArchivedLists"
import Layout from "../core/layouts/layout"
import OwnedList from "../lists/components/ownedList"
import getArchivedLists from "../lists/queries/getArchivedLists"
import { Head, useQuery } from "blitz"
import checkIfUnreadMessage from "app/queries/checkIfUnreadMessages"
import checkIfUnreadMessage from "app/chats/queries/checkIfUnreadMessages"

export default function ArchivedLists() {
const [archivedLists, archivedListsExtras] = useQuery(getArchivedLists, null, {
Expand Down
8 changes: 4 additions & 4 deletions app/pages/chats.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Flex, Heading, Stack, Text, WrapItem } from "@chakra-ui/react"
import Layout from "../components/layout"
import ChatPreview from "../components/chats/chatPreview"
import Layout from "../core/layouts/layout"
import ChatPreview from "../chats/components/chatPreview"
import { Head, useQuery } from "blitz"
import getChatsWithLastMessage from "../queries/getChatsWithLastMessage"
import getChatsWithLastMessage from "../chats/queries/getChatsWithLastMessage"

import { useCurrentUser } from "app/core/hooks/useCurrentUser"
import checkIfUnreadMessage from "app/queries/checkIfUnreadMessages"
import checkIfUnreadMessage from "app/chats/queries/checkIfUnreadMessages"
import { useLayoutEffect } from "react"

export default function Chats() {
Expand Down
20 changes: 10 additions & 10 deletions app/pages/chats/[chatId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ import {
useToast,
Box,
} from "@chakra-ui/react"
import AdminMessage from "app/components/chats/adminMessage"
import OwnMessage from "app/components/chats/ownMessage"
import StrangeMessage from "app/components/chats/strangeMessage"
import Layout from "app/components/layout"
import AdminMessage from "app/chats/components/adminMessage"
import OwnMessage from "app/chats/components/ownMessage"
import StrangeMessage from "app/chats/components/strangeMessage"
import Layout from "app/core/layouts/layout"
import { useCurrentUser } from "app/core/hooks/useCurrentUser"
import getMessagesByChat from "app/queries/getMessagesByChat"
import getMessagesByChat from "app/chats/queries/getMessagesByChat"
import { useQuery, useParam, useMutation, Head, AuthorizationError } from "blitz"
import { Form, Field } from "react-final-form"
import { FORM_ERROR } from "final-form"
import getParticipantsByChatId from "../../queries/getParticipantsByChatId"
import sendMessage from "../../mutations/sendMessage"
import markMessagesAsRead from "../../mutations/markMessagesAsRead"
import getParticipantsByChatId from "../../chats/queries/getParticipantsByChatId"
import sendMessage from "../../chats/mutations/sendMessage"
import markMessagesAsRead from "../../chats/mutations/markMessagesAsRead"
import { useEffect, useLayoutEffect } from "react"
import { RiMailSendLine } from "react-icons/ri"
import { BiUserCircle } from "react-icons/bi"
import markAdminMessagesAsRead from "app/mutations/markAdminAsRead"
import checkIfUnreadMessage from "app/queries/checkIfUnreadMessages"
import markAdminMessagesAsRead from "app/chats/mutations/markAdminAsRead"
import checkIfUnreadMessage from "app/chats/queries/checkIfUnreadMessages"
import { appLogger as log } from "app/lib/logger"

export default function Chat() {
Expand Down
4 changes: 2 additions & 2 deletions app/pages/datenschutz.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ import {
Wrap,
WrapItem,
} from "@chakra-ui/react"
import Layout from "../components/layout"
import Layout from "../core/layouts/layout"
import { Head, useQuery } from "blitz"
import checkIfUnreadMessage from "app/queries/checkIfUnreadMessages"
import checkIfUnreadMessage from "app/chats/queries/checkIfUnreadMessages"
import { useCurrentUser } from "app/core/hooks/useCurrentUser"

function DatenschutzLoggedOut() {
Expand Down
8 changes: 4 additions & 4 deletions app/pages/impressum.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Flex, Heading, Link, Text, Wrap, WrapItem } from "@chakra-ui/react"
import Layout from "../components/layout"
import OwnedList from "../components/ownedList"
import getArchivedLists from "../queries/getArchivedLists"
import Layout from "../core/layouts/layout"
import OwnedList from "../lists/components/ownedList"
import getArchivedLists from "../lists/queries/getArchivedLists"
import { Head, useQuery } from "blitz"
import checkIfUnreadMessage from "app/queries/checkIfUnreadMessages"
import checkIfUnreadMessage from "app/chats/queries/checkIfUnreadMessages"
import { useCurrentUser } from "app/core/hooks/useCurrentUser"

function ImpressumLoggedIn() {
Expand Down
18 changes: 9 additions & 9 deletions app/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ import { BlitzPage, Head, useMutation } from "blitz"
import { useCurrentUser } from "app/core/hooks/useCurrentUser"

import { Flex, Wrap, WrapItem, Heading, Text, Button, HStack } from "@chakra-ui/react"
import Layout from "../components/layout"
import Layout from "../core/layouts/layout"
import { useQuery } from "blitz"
import getOwnListByStatus from "../queries/getMyLists"
import OwnedList from "../components/ownedList"
import PublicList from "../components/publicList"
import getAvailableLists from "../queries/getAvailableLists"
import getPosition from "../queries/getPositionOfUser"
import getOwnListByStatus from "../lists/queries/getMyLists"
import OwnedList from "../lists/components/ownedList"
import PublicList from "../lists/components/publicList"
import getAvailableLists from "../lists/queries/getAvailableLists"
import getPosition from "../core/queries/getPositionOfUser"
import { useEffect, useState } from "react"
import { LoginForm } from "app/auth/components/LoginForm"
import { SignupForm } from "app/auth/components/SignupForm"
import { useRouter } from "blitz"
import { getDistanceByHaversine, useCurrentPosition } from "../lib/position"
import CreateLists from "../components/createLists"
import FrontPage from "../components/LandingPage/frontPage"
import checkIfUnreadMessage from "app/queries/checkIfUnreadMessages"
import CreateLists from "../lists/components/createLists"
import FrontPage from "../landingPage/components/frontPage"
import checkIfUnreadMessage from "app/chats/queries/checkIfUnreadMessages"
/*
* This file is just for a pleasant getting started page for your new app.
* You can delete everything in here and start from scratch if you like.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BlitzPage, useRouterQuery, Link, useMutation } from "blitz"
import Layout from "app/core/layouts/Layout"
import { LabeledTextField } from "app/core/components/LabeledTextField"
import { ResetPasswordForm, FORM_ERROR } from "app/core/components/resetPasswordForm"
import { ResetPassword } from "app/auth/validations"
Expand Down Expand Up @@ -63,6 +62,5 @@ const ResetPasswordPage: BlitzPage = () => {
}

ResetPasswordPage.redirectAuthenticatedTo = "/"
ResetPasswordPage.getLayout = (page) => <Layout title="Reset Your Password">{page}</Layout>

export default ResetPasswordPage

0 comments on commit f13d282

Please sign in to comment.