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

Case project #38

Merged
merged 11 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions LibraryTrackingApp/src/frontend/layouts/Anon/components/Footer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {
Link as CLink,
Flex,
} from "@chakra-ui/react";
import Link from "next/link";


import React from "react";
Expand All @@ -18,15 +19,23 @@ const Footer = () => {


const FooterData = () => {
const startYear = 2023;
const startYear = 2024;
const currentYear = new Date().getFullYear();
let yearText;
if (currentYear > startYear) {
yearText = `${startYear}-${currentYear}`;
} else {
yearText = `${startYear}`;
}
return <> {yearText} &copy; Tüm Hakları Saklıdır.</>;
const utmParameters = '?utm_source=library-tracking-app&utm_medium=footer&utm_campaign=yourcampaign';

return (
<>
<Link href={`https://ilyasbozdemir.dev/${utmParameters}`} target={'_blank'}>
<>{yearText} İlyas Bozdemir &copy; Tüm Hakları Saklıdır.</>
</Link>
</>
);
};
export async function getStaticProps({ locale }) {
return {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ const NavItem = ({ isMaximized, handleMaximizeToggle }) => {

return (
<>

<HStack spacing={3}>
<Icon
as={TfiHome}
Expand Down
52 changes: 41 additions & 11 deletions LibraryTrackingApp/src/frontend/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,49 @@ const { i18n } = require("./next-i18next.config");
const routes = require("./routes");

const nextConfig = {
i18n,
reactStrictMode: true,

async rewrites() {
const rewritesConfig = Object.values(routes).flatMap((route) =>
Object.entries(route).map(([path, c]) => ({
source: c.config.rewrite.source,
destination: c.config.rewrite.destination,
}))
);

return rewritesConfig;
exportTrailingSlash: true,
exportPathMap: async function (
defaultPathMap,
{ dev, dir, outDir, distDir, buildId }
) {
return {
// paths...
};
},
// Zaman aşımını artırın
exportTrailingSlash: true,
exportPathMap: async function (
defaultPathMap,
{ dev, dir, outDir, distDir, buildId }
) {
return {
// paths...
};
},
// Zaman aşımını artırın
exportTrailingSlash: true,
exportPathMap: async function (
defaultPathMap,
{ dev, dir, outDir, distDir, buildId }
) {
return {
// paths...
};
},
// Zaman aşımını artırın
exportTrailingSlash: true,
exportPathMap: async function (
defaultPathMap,
{ dev, dir, outDir, distDir, buildId }
) {
return {
// paths...
};
},
// Zaman aşımını artırın
exportTimeout: 1000, // 1 saniye yerine başka bir değer de kullanabilirsiniz

};

module.exports = nextConfig;
10 changes: 5 additions & 5 deletions LibraryTrackingApp/src/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions LibraryTrackingApp/src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
"https": "^1.0.0",
"i18next": "^23.7.8",
"leaflet-defaulticon-compatibility": "^0.1.2",
"next": "13.5.6",
"next": "^13.2.5",
"next-i18next": "^15.1.1",
"next-seo": "^6.4.0",
"postcss": "8.4.31",
"react": "18.2.0",
"react-burger-menu": "^3.0.9",
"react-dom": "18.2.0",
"react-floating-whatsapp": "^5.0.8",
"react-icons": "^4.12.0",
"react-icons": "^5.2.1",
"react-joyride": "^2.8.1",
"react-leaflet": "^4.2.1",
"react-pdf": "^8.0.0",
Expand Down
66 changes: 41 additions & 25 deletions LibraryTrackingApp/src/frontend/pages/_app.jsx
Original file line number Diff line number Diff line change
@@ -1,32 +1,53 @@
import { ChakraProvider, extendTheme } from "@chakra-ui/react";
import { Alert, AlertIcon, ChakraProvider, Text, extendTheme } from "@chakra-ui/react";
import dynamic from "next/dynamic";

const AnonLayout = dynamic(() => import("@/layouts/Anon/layout"));
const AppLayout = dynamic(() => import("@/layouts/App/layout"));
const MeLayout = dynamic(() => import("@/layouts/Me/layout"));
const AdminLayout = dynamic(() => import("@/layouts/Admin/layout"));
import ForumLayout from "@/layouts/Forum/layout";

const ForumLayout = dynamic(() => import("@/layouts/Forum/layout"));
const PlaceholderLayout = dynamic(() => import("@/layouts/Placeholder/layout"));

import { useColorMode, colorMode } from "@chakra-ui/react";

import "../styles/globals.css";
import AOS from "aos";
import "aos/dist/aos.css";
import { useRouter } from "next/router";
import { useEffect } from "react";
import { useEffect, useState } from "react";
import { darkTheme, lightTheme } from "@/src/foundations/colors";
import { AuthContextProvider, AuthProvider } from "@/contexts/AuthContext";
import { AppContextProvider } from "@/contexts/AppContext";
import { errorStatusCodes } from "@/constants/errorStatusCodes";
import { site } from "@/constants/site";
import theme from "@/src/theme";

function MyApp({ Component, pageProps, session, statusCode }) {
const router = useRouter();
const AlertData = () => {
const [error, setError] = useState(null);

const theme = extendTheme(
colorMode === "light" ? lightTheme.colors : darkTheme.colors
);
useEffect(() => {
const fetchData = async () => {
try {
const response = await axios.get(site.API_BASE_URL + '');
} catch (error) {
setError(error.message);
}
};

fetchData();
}, []);
return (<>


<Alert status={error ? 'warning' : 'info'} justifyContent={'center'}>
<AlertIcon />
<Text as={'p'}>
{error ? 'Üzgünüm, veritabanından veri çekilemiyor. Fakat Sayfalar arasında gezinmeye devam edebilirsiniz.' : 'Harika! Veriler başarıyla alındı.'}
</Text>
</Alert></>)
}

function MyApp({ Component, pageProps, statusCode = 200 }) {
const router = useRouter();

const placeholderRoutes = [
"/privacy-policy",
Expand Down Expand Up @@ -77,6 +98,9 @@ function MyApp({ Component, pageProps, session, statusCode }) {
AOS.refresh();
}, []);




return (
<>
{errorStatusCodes.includes(statusCode) ? (
Expand All @@ -87,7 +111,14 @@ function MyApp({ Component, pageProps, session, statusCode }) {
<AppContextProvider>
<AuthContextProvider>
<ChakraProvider theme={theme} resetCSS>

{/*

*/}

<AlertData />
<Layout>

<Component {...pageProps} />
</Layout>
</ChakraProvider>
Expand All @@ -98,20 +129,5 @@ function MyApp({ Component, pageProps, session, statusCode }) {
);
}

MyApp.getInitialProps = async (appContext) => {
const { Component, ctx } = appContext;
let pageProps = {};
let session = {};

if (Component.getInitialProps) {
pageProps = await Component.getInitialProps(ctx);
session = await Component.getInitialProps(ctx);
}

const { res, err } = ctx;
const statusCode = res ? res.statusCode : err ? err.statusCode : null;

return { pageProps, session, statusCode };
};

export default MyApp;
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react'

function NewPage() {
return (
<div>NewPage</div>
)
}

export default NewPage
5 changes: 3 additions & 2 deletions LibraryTrackingApp/src/frontend/src/theme.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { extendTheme } from "@chakra-ui/react";
import { styles } from "./foundations/styles";
import { config } from "./foundations/config";
import { colors } from "./foundations/colors";
import { lightTheme, darkTheme } from "./foundations/colors";
import { fonts } from "./foundations/fonts";
import { fontSizes } from "./foundations/fontSizes";
import { fontWeights } from "./foundations/fontWeights";
Expand All @@ -15,7 +15,8 @@ import { zIndices } from "./foundations/zIndices";
const theme = extendTheme({
styles,
config,
colors,
lightTheme,
darkTheme,
fonts,
fontSizes,
fontWeights,
Expand Down
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading