Skip to content

Commit

Permalink
Merge pull request #310 from BlackCubes/development
Browse files Browse the repository at this point in the history
Minor Dev to Main
  • Loading branch information
BlackCubes authored Sep 26, 2024
2 parents 7495698 + 6a79221 commit 00550ff
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 435 deletions.
2 changes: 1 addition & 1 deletion web/app/api/coreSplitApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default createApi({
refetchOnMountOrArgChange: true,
refetchOnReconnect: true,

tagTypes: ['Article', 'Category', 'Tag', 'Work'],
tagTypes: ['Article', 'Category', 'Tag'],

endpoints: () => ({}),
});
10 changes: 5 additions & 5 deletions web/common/components/ItemLink/itemData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ type TItemData = {
};

const itemData: TItemData[] = [
{
id: 'b1b19382-6b92-4515-93c7-5446bfa717d5',
title: 'Work',
path: '/work',
},
// {
// id: 'b1b19382-6b92-4515-93c7-5446bfa717d5',
// title: 'Work',
// path: '/work',
// },
{
id: 'b9c2b576-5164-449a-ab4b-ad0ebeb39c27',
title: 'Articles',
Expand Down
38 changes: 0 additions & 38 deletions web/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,6 @@ import { useEffect, useState } from 'react';
import type { NextPage } from 'next';
import Head from 'next/head';

import { nextReduxWrapper } from 'app';
import {
getArticles,
getRunningOperationPromises as getArticlesRunningOperationPromises,
} from 'app/api/articleExtendedApi';
import {
getWorksByCategory,
getRunningOperationPromises as getWorksRunningOperationPromises,
} from 'app/api/workExtendedApi';

import LineSeparator from 'common/components/LineSeparator';
import LoadingIcon from 'common/components/LoadingIcon';
import PageContainer from 'common/components/PageContainer';
Expand All @@ -33,34 +23,6 @@ import environment from 'environment';
interface IHome {
isFirstMount: boolean;
}

export const getStaticProps = nextReduxWrapper.getStaticProps(
(store) => async () => {
store.dispatch(
getArticles.initiate({
category: 0,
limit: 3,
tags: [],
})
);

await Promise.all(getArticlesRunningOperationPromises());

store.dispatch(
getWorksByCategory.initiate({
category: 'Work',
limit: 5,
})
);

await Promise.all(getWorksRunningOperationPromises());

return {
props: {},
};
}
);

const Home: NextPage<IHome> = ({ isFirstMount }) => {
const [finishIsFirstMount, setFinishIsFirstMount] = useState(isFirstMount);

Expand Down
62 changes: 31 additions & 31 deletions web/pages/server-sitemap.xml/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getServerSideSitemap, ISitemapField } from 'next-sitemap';

import { createAppStore } from 'app';
import { getArticles } from 'app/api/articleExtendedApi';
import { getWorksByCategory } from 'app/api/workExtendedApi';
// import { getWorksByCategory } from 'app/api/workExtendedApi';

import environment from 'environment';

Expand All @@ -27,44 +27,44 @@ export const getServerSideProps: GetServerSideProps = async (ctx) => {
priority: 0.9,
}));

const { data: works } = await store.dispatch(
getWorksByCategory.initiate({
category: 'Work',
limit: 4,
})
);
// const { data: works } = await store.dispatch(
// getWorksByCategory.initiate({
// category: 'Work',
// limit: 4,
// })
// );

let worksFields: ISitemapField[] = [];
// let worksFields: ISitemapField[] = [];

if (works)
worksFields = works.items.map((work) => ({
changefreq: 'monthly',
loc: `${environment.webRoute}/work/${work.meta.slug}`,
lastmod: new Date().toISOString(),
priority: 0.7,
}));
// if (works)
// worksFields = works.items.map((work) => ({
// changefreq: 'monthly',
// loc: `${environment.webRoute}/work/${work.meta.slug}`,
// lastmod: new Date().toISOString(),
// priority: 0.7,
// }));

const { data: personals } = await store.dispatch(
getWorksByCategory.initiate({
category: 'Personal',
limit: 4,
})
);
// const { data: personals } = await store.dispatch(
// getWorksByCategory.initiate({
// category: 'Personal',
// limit: 4,
// })
// );

let personalsFields: ISitemapField[] = [];
// let personalsFields: ISitemapField[] = [];

if (personals)
personalsFields = personals.items.map((personal) => ({
changefreq: 'monthly',
loc: `${environment.webRoute}/work/${personal.meta.slug}`,
lastmod: new Date().toISOString(),
priority: 0.7,
}));
// if (personals)
// personalsFields = personals.items.map((personal) => ({
// changefreq: 'monthly',
// loc: `${environment.webRoute}/work/${personal.meta.slug}`,
// lastmod: new Date().toISOString(),
// priority: 0.7,
// }));

return getServerSideSitemap(ctx, [
...articlesFields,
...worksFields,
...personalsFields,
// ...worksFields,
// ...personalsFields,
]);
};

Expand Down
225 changes: 0 additions & 225 deletions web/pages/work/[slug].tsx

This file was deleted.

Loading

0 comments on commit 00550ff

Please sign in to comment.