Skip to content

Commit

Permalink
feat(build): done changes for build
Browse files Browse the repository at this point in the history
  • Loading branch information
faisalEsMagico committed Dec 14, 2023
1 parent 26f970b commit 212c0ce
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 13 deletions.
20 changes: 9 additions & 11 deletions src/app/context/AuthContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,22 @@ const AuthProvider = createContext<AuthContextValue>({
});

const AuthContextContext = ({ children }: { children: React.ReactElement }) => {
const data = localStorage.getItem('adminData') || '';
let parseData = null;
if (data !== '') {
parseData = JSON.parse(data);
}
// const parseData=JSON.parse(data)
const [adminData, setAdminData] = useState<AdminDataType | null>(
parseData ?? null
);
const [adminData, setAdminData] = useState<AdminDataType | null>(null);
const router = useRouter();

useEffect(() => {
if (!adminData?.admin) {
const data = localStorage.getItem('adminData') || '';
let parseData = null;
if (data !== '') {
parseData = JSON.parse(data);
}
if (!parseData?.admin) {
router.push('/login');
} else {
router.push('/3cp/marketplace');
setAdminData(parseData);
}
}, [adminData?.admin, router]);
}, [router]);

return (
<AuthProvider.Provider
Expand Down
2 changes: 1 addition & 1 deletion src/app/propTypes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export type OptionType = {

export type levelsWithQuestionType = {
competencyLevelNumber: number;
competencyLevelName: string;
competencyLevelName: string | number;
question: string;
questionId: number;
questionPresent: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/components/questionBank/SavedLevels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const SavedLevels = ({
value={competencyLevelName}
onChange={() => null}
width='704px'
placeholder={competencyLevelName}
placeholder={competencyLevelName?.toString()}
paddingY='2px'
isDisabled={true}
/>
Expand Down

0 comments on commit 212c0ce

Please sign in to comment.