Skip to content

Commit ff0e839

Browse files
committed
feat(): Secret feature to hide all the features.
1 parent 85cbdf9 commit ff0e839

6 files changed

Lines changed: 21 additions & 10 deletions

File tree

src/components/CardComponent/CardExport.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ const Card = ({
5959
>
6060
{titleText}
6161
</Text>
62-
<Button size="sm" py={0} px={1} as={Link} to={'/projects/' + icon}>
62+
<Button size="sm" py={0} px={1} as={Link} to={'projects/' + icon}>
6363
Know More
6464
</Button>
6565
</HStack>

src/router/PublicRoutes.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import isEmpty from 'lodash/isEmpty';
12
import {
23
Navigate,
34
Outlet,
@@ -11,6 +12,10 @@ import ArticlesScreen from '../screens/articles/ArticlesScreen';
1112
import ProjectsScreen from '../screens/projects/ProjectsScreen';
1213
import ArticleEditor from '@screens/articleEditor/ArticleEditor';
1314

15+
export const BASE_URL = 'secret_path';
16+
export const BASE_URL_ROUTE = isEmpty(BASE_URL) ? '/' : `/${BASE_URL}`;
17+
export const BASE_NAV_ROUTE = isEmpty(BASE_URL) ? '/' : `/${BASE_URL}/`;
18+
1419
const publicRouter = createBrowserRouter(
1520
createRoutesFromChildren(
1621
<Route
@@ -21,8 +26,8 @@ const publicRouter = createBrowserRouter(
2126
</>
2227
}
2328
>
24-
<Route path="" element={<LazyHiderScreen />} />
25-
<Route path="version2" element={<LazyHostScreen />}>
29+
{!isEmpty(BASE_URL) && <Route path="" element={<LazyHiderScreen />} />}
30+
<Route path={BASE_URL} element={<LazyHostScreen />}>
2631
<Route path="" element={<MainScreen />} />
2732
<Route path="articles" element={<ArticlesScreen />} />
2833
<Route path="privateRoute" element={<ArticleEditor />} />

src/screens/common/Footer.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import { Box, Text } from '@chakra-ui/react';
22
import { HoverBorderGradient } from '@components';
3+
import { BASE_URL_ROUTE } from '@router';
34
import { Link } from 'react-router-dom';
45

56
const FooterEndText = () => (
67
<Text fontSize={'md'}>
78
© {new Date().getFullYear()}{' '}
8-
<Link to={'/'} color="violet">
9+
<Link to={BASE_URL_ROUTE} color="violet">
910
Amit Raikwar
1011
</Link>{' '}
1112
| All rights reserved

src/screens/common/NavigationBar.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { useRef } from 'react';
66
import { useTranslation } from 'react-i18next';
77
import { useLocation, useNavigate } from 'react-router-dom';
88
import { useMoveToTop } from '@hooks';
9+
import { BASE_URL_ROUTE } from '@router';
910

1011
const NavigationLink = [
1112
{
@@ -82,7 +83,7 @@ const NavigationBar = () => {
8283
alt={'logo'}
8384
w={8}
8485
onClick={() => {
85-
navigate('/');
86+
navigate(BASE_URL_ROUTE);
8687
moveToTop();
8788
}}
8889
_hover={{
@@ -101,7 +102,7 @@ const NavigationBar = () => {
101102
bg={'rgba(255, 255, 255, 0.1)'}
102103
backdropFilter={'blur(20px)'}
103104
transition={'background-color 0.3s'}
104-
display={pathName !== '/' ? 'none' : 'flex'}
105+
display={pathName !== BASE_URL_ROUTE ? 'none' : 'flex'}
105106
>
106107
{NavigationLink.map(({ name, href }) => (
107108
<LinkButton
@@ -123,7 +124,7 @@ const NavigationBar = () => {
123124
<LinkButton
124125
key={ArticleLink.name}
125126
text={t(ArticleLink.name)}
126-
href={ArticleLink.href}
127+
href={BASE_URL_ROUTE + '/' + ArticleLink.href}
127128
fontSize={'lg'}
128129
animationOnHover
129130
/>

src/screens/hider/Hider.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ const Hider = () => {
1313
alignItems={'center'}
1414
>
1515
<Text color={'white'} textAlign={'center'} fontSize={'2xl'}>
16-
You cannot access this website until you know the person personally 😝
16+
You cannot 🚫access this website until you know the me personally 😝.
17+
<br />
1718
<br />
1819
This is temporary🚧, I will remove this soon⏳.
1920
</Text>

src/screens/projects/ProjectsScreen.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ import { ProjectItem } from './components';
55
import { useEffect, useRef } from 'react';
66
import { useLocation } from 'react-router-dom';
77
import { useCursor } from '@components';
8+
import { BASE_URL } from '@router';
89

910
const Projects = () => {
1011
const { setCursorType } = useCursor();
1112
const location = useLocation();
12-
const secondName = location.pathname.split('/')[2];
13+
const name = location.pathname.split('/');
14+
15+
const projectName = name[1] === BASE_URL ? name[3] : name[2];
1316
const ref = useRef(null);
1417

1518
const filteredProjects = PROJECT_DATA.filter((project) =>
16-
project.icon === secondName ? project : null,
19+
project.icon === projectName ? project : null,
1720
);
1821

1922
useEffect(() => {

0 commit comments

Comments
 (0)