Skip to content

Commit 8236a71

Browse files
authored
Merge pull request #46 from Zain-ul-din/production
Production
2 parents 67e865f + ac11989 commit 8236a71

File tree

18 files changed

+946
-545
lines changed

18 files changed

+946
-545
lines changed

next.config.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
const nextConfig = {
33
reactStrictMode: false,
44
images: {
5+
unoptimized: true,
56
remotePatterns: [
67
{
7-
protocol: "https",
8-
hostname: "**",
9-
},
10-
],
8+
protocol: 'https',
9+
hostname: '**'
10+
}
11+
]
1112
}
12-
}
13+
};
1314

14-
module.exports = nextConfig
15+
module.exports = nextConfig;

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"lint": "next lint",
1010
"format": "prettier --write ./src",
1111
"postbuild": "next-sitemap",
12-
"prepare": "husky"
12+
"prepare": "husky",
13+
"export": "next export"
1314
},
1415
"dependencies": {
1516
"@chakra-ui/icons": "^2.0.18",

public/google309f484796503244.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
google-site-verification: google309f484796503244.html

public/sitemap-0.xml

Lines changed: 690 additions & 453 deletions
Large diffs are not rendered by default.

src/components/Footer.tsx

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,27 @@ export default function Footer({ fixedBottom }: { fixedBottom: boolean }): JSX.E
5353
<Container
5454
as={Stack}
5555
maxW={'6xl'}
56-
py={2}
56+
padding={0}
57+
py={4}
58+
px={0.1}
5759
direction={{ base: 'column', md: 'row' }}
5860
spacing={4}
5961
justify={{ base: 'center', md: 'space-between' }}
6062
align={{ base: 'center', md: 'center' }}>
61-
<Flex flexDirection={'row'}>
62-
<Text>© OPEN SOURCE MADE WITH </Text>
63-
<Box color={'red'} pt={'5px'} px={'3px'}>
64-
{' '}
65-
<BsSuitHeartFill />
66-
</Box>
67-
</Flex>
63+
<Link href={'https://www.orbisdev.co/'}>
64+
<Flex
65+
color={'orange.400'}
66+
fontWeight={'medium'}
67+
flexDirection={'row'}
68+
align={'center'}
69+
fontSize={'md'}
70+
gap={1}>
71+
{/* <Text>© OPEN SOURCE MADE WITH </Text> */}
72+
<Text>Backed By - OrbisDev</Text>
73+
<ExternalLinkIcon />
74+
<Box> {/* <BsSuitHeartFill /> */}</Box>
75+
</Flex>
76+
</Link>
6877

6978
<Stack direction={'row'} spacing={4}>
7079
<SocialButton label={'GitHub Front-End'} href={LINKS.GIT_HUB_REPO_LINK}>
@@ -121,6 +130,7 @@ const FooterLinks = () => {
121130
<Flex
122131
gap={isUnder600 ? '1.5rem' : '4rem'}
123132
columnGap={'1rem'}
133+
rowGap={'1rem'}
124134
maxWidth={'1200px'}
125135
margin={'0.5rem auto'}
126136
justifyContent={'center'}
@@ -174,6 +184,7 @@ const githubApiResponseSample = {
174184
type GithubApiResponse = typeof githubApiResponseSample;
175185

176186
import Link from 'next/link';
187+
import { ExternalLinkIcon } from '@chakra-ui/icons';
177188

178189
const GithubContributors = ({ urls }: { urls: string[] }) => {
179190
const [contributors, setContributors] = useState<Array<GithubApiResponse>>([]);

src/components/Timetable.tsx

Lines changed: 57 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,10 @@ import {
2828
AccordionIcon
2929
} from '@chakra-ui/react';
3030

31-
import { FaFileImage } from 'react-icons/fa';
3231
import TimeTablePrint from './TimetablePrint';
3332
import ReactToPrint from 'react-to-print';
3433

35-
import { APIS_ENDPOINTS, ROUTING, timetableHeadTitles } from '~/lib/constant';
34+
import { ROUTING, timetableHeadTitles } from '~/lib/constant';
3635

3736
const day_sorter = {
3837
monday: 1,
@@ -104,77 +103,73 @@ export default function Timetable({ metaData, timetableData, ad }: IProps) {
104103
updatedAt={new Date(timetableData.updatedAt as string)}
105104
/>
106105

107-
{!false ? (
106+
{/* {!false ? (
108107
<FreeForAdvertisement link="/discussions?active_route=View&discussion_id=FLbqhsFKlwny9VxInN8b" />
109108
) : (
110109
<Educative mx={'1rem'} link={ad.link} description={ad.description} title={ad.title} />
111-
)}
110+
)} */}
112111

113112
{/* <RenderOnce uid="Palestine_Side">
114113
<PalestineSideAd url="/discussions?active_route=View&discussion_id=mIPtC9zPO8GaH7Pltx87" />
115114
</RenderOnce> */}
116115

117116
<div>
118-
{!timetableData ? (
119-
<Loader>Loading...</Loader>
120-
) : (
121-
<>
122-
<div ref={printTableRef} className="print_timetable">
123-
<TimeTablePrint
124-
headTitles={timetableHeadTitles}
125-
data={timetableData.timetable}
126-
payload={`${metaData} (Updated At: ${new Date(
127-
timetableData.updatedAt
128-
).toDateString()})`}
129-
/>
130-
</div>
117+
<>
118+
<div ref={printTableRef} className="print_timetable">
119+
<TimeTablePrint
120+
headTitles={timetableHeadTitles}
121+
data={timetableData.timetable}
122+
payload={`${metaData} (Updated At: ${new Date(
123+
timetableData.updatedAt
124+
).toDateString()})`}
125+
/>
126+
</div>
131127

132-
{/* chart render */}
133-
<Accordion mx={2} my={4} mb={8}>
134-
<AccordionItem>
135-
<AccordionButton>
136-
<Box mr={2}>Show Chart</Box>
137-
<AccordionIcon />
138-
</AccordionButton>
139-
<AccordionPanel>
140-
<TimetableChart
141-
timetable={Object.entries(timetableData.timetable).sort(([lhs], [rhs]) => {
142-
let day1 = lhs.toLowerCase();
143-
let day2 = rhs.toLowerCase();
144-
return day_sorter[day1 as keyof object] - day_sorter[day2 as keyof object];
145-
})}
146-
/>
147-
</AccordionPanel>
148-
</AccordionItem>
149-
</Accordion>
128+
{/* chart render */}
129+
<Accordion mx={2} my={4} mb={8}>
130+
<AccordionItem>
131+
<AccordionButton>
132+
<Box mr={2}>Show Chart</Box>
133+
<AccordionIcon />
134+
</AccordionButton>
135+
<AccordionPanel>
136+
<TimetableChart
137+
timetable={Object.entries(timetableData.timetable).sort(([lhs], [rhs]) => {
138+
let day1 = lhs.toLowerCase();
139+
let day2 = rhs.toLowerCase();
140+
return day_sorter[day1 as keyof object] - day_sorter[day2 as keyof object];
141+
})}
142+
/>
143+
</AccordionPanel>
144+
</AccordionItem>
145+
</Accordion>
150146

151-
{Object.entries(timetableData.timetable)
152-
.sort(([lhs], [rhs]) => {
153-
let day1 = lhs.toLowerCase();
154-
let day2 = rhs.toLowerCase();
155-
return day_sorter[day1 as keyof object] - day_sorter[day2 as keyof object];
156-
})
157-
.map(([day, data], idx) => {
158-
return (
159-
<React.Fragment key={idx}>
160-
{(data as Array<TimetableData>).length > 0 && (
161-
<Card
162-
data={(data as Array<TimetableData>).sort((lhs, rhs) => {
163-
return (
164-
lhs.startTime.hours * 60 +
165-
lhs.startTime.minutes -
166-
(rhs.startTime.hours * 60 + rhs.startTime.minutes)
167-
);
168-
})}
169-
day={day}
170-
idx={idx}
171-
/>
172-
)}
173-
</React.Fragment>
174-
);
175-
})}
176-
</>
177-
)}
147+
{Object.entries(timetableData.timetable)
148+
.sort(([lhs], [rhs]) => {
149+
let day1 = lhs.toLowerCase();
150+
let day2 = rhs.toLowerCase();
151+
return day_sorter[day1 as keyof object] - day_sorter[day2 as keyof object];
152+
})
153+
.map(([day, data], idx) => {
154+
return (
155+
<React.Fragment key={idx}>
156+
{(data as Array<TimetableData>).length > 0 && (
157+
<Card
158+
data={(data as Array<TimetableData>).sort((lhs, rhs) => {
159+
return (
160+
lhs.startTime.hours * 60 +
161+
lhs.startTime.minutes -
162+
(rhs.startTime.hours * 60 + rhs.startTime.minutes)
163+
);
164+
})}
165+
day={day}
166+
idx={idx}
167+
/>
168+
)}
169+
</React.Fragment>
170+
);
171+
})}
172+
</>
178173
</div>
179174
</div>
180175
</>

src/components/pastpaper/PastPapersToast.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ export default function PastPaperToast() {
1515
const toastId = 'past-paper-toast';
1616

1717
useEffect(() => {
18-
if (router.pathname === ROUTING.past_papers || !show) return;
18+
if (router.pathname === ROUTING.past_papers || router.pathname.includes('/blogs') || !show)
19+
return;
1920
setShow(false);
2021

2122
toast({

src/lib/FirebaseAnalysis.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { firebase, userColsRef } from './firebase';
44
import { useEffect } from 'react';
55
import { UserDocType } from './firebase_doctypes';
66

7-
export function addLoggedInUser(user: User) {
7+
export async function addLoggedInUser(user: User) {
88
if (!user) return;
99

1010
const userDoc = doc(userColsRef, user.email as string);
@@ -23,11 +23,13 @@ export function addLoggedInUser(user: User) {
2323
isPublic: true,
2424
repo: 0
2525
};
26-
27-
getDoc(userDoc).then((doc) => {
28-
if (doc.exists()) return;
26+
27+
try {
28+
const docSnapShot = await getDoc(userDoc);
29+
if(!docSnapShot.exists()) setDoc(userDoc, userData, { merge: true });
30+
} catch(_) {
2931
setDoc(userDoc, userData, { merge: true });
30-
});
32+
}
3133
}
3234

3335
export enum FIREBASE_ANALYTICS_EVENTS {

src/lib/constant.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,8 @@ export const ROUTING = {
8181
rooms: '/timetable/rooms',
8282
clash_resolver: '/util/timetable_clashresolver',
8383
room_activities: '/room-activities',
84-
past_papers: '/pastpaper'
84+
past_papers: '/pastpaper',
85+
blogs: '/blogs'
8586
};
8687

8788
export const APIS_ENDPOINTS = {

src/lib/firebase.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export const workFlowColRef = collection(firebase.firebaseStore, 'workflow');
6666
export const discussionSubColName = 'participants';
6767
export const electionColRef = collection(firebase.firebaseStore, 'election');
6868
export const newsLetterColRef = collection(firebase.firebaseStore, 'news_letter');
69+
export const affiliatesColRef = collection(firebase.firebaseStore, 'affiliates');
6970

7071
///
7172
/// firebase storage

0 commit comments

Comments
 (0)