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

fix: navbar and remove logs #84

Merged
merged 1 commit into from
Sep 5, 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
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
],
"rules": {
"react-hooks/exhaustive-deps": "warn",
"@typescript-eslint/no-explicit-any": "off"
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-unused-vars": "off"
},
"ignorePatterns": ["**/*.css","**/*.scss"]
}
1 change: 0 additions & 1 deletion src/app/college/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export default function Home() {
}
// Set the updated array in localStorage
}
console.log('selectedcollege', selectedCollegeNames)
}, [id, selectedCollege, selectedCollegeNames])
return (
<main className="flex min-h-screen flex-col items-center justify-center p-24">
Expand Down
1 change: 0 additions & 1 deletion src/app/timeline/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ const Timeline = () => {
return Array.from({ length: 2 }).map((_, index) => <PostSkeleton key={index} />)
}
if (error) {
console.log(error)
return <div>Something Went Wrong!</div>
}
return timelinePosts?.map((post: any) => {
Expand Down
2 changes: 0 additions & 2 deletions src/app/v2/onboarding/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ import OnboardingSlider from '@/components/atoms/OnboardingSlider'
import useDeviceType from '@/hooks/useDeviceType'

const Onboarding = () => {
const { isDesktop, isTablet, isMobile } = useDeviceType()
console.log(isDesktop, isTablet, isMobile)
return (
<div className="h-screen">
<div className="flex flex-col h-screen">
Expand Down
1 change: 0 additions & 1 deletion src/components/Notifiaction/AssignNotification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const AssignNotification = ({ id, senderName, communityGroupId, message, created
}

updateIsSeen(dataToPush)
console.log('postId', communityGroupId)
}

return (
Expand Down
1 change: 0 additions & 1 deletion src/components/Notifiaction/CommentNotification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const CommentNotification = ({ id, senderName, communityPostId, message, created
id: id,
}
updateIsSeen(dataToPush)
console.log('postId', communityPostId)
}
return (
<div key={id} className="bg-slate-50 p-2 border-b border-slate-300">
Expand Down
2 changes: 0 additions & 2 deletions src/components/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const SearchBar = () => {
const [searchHistoryShown, setSearchHistoryShown] = useState(true)

const { isLoading, data } = useUniversitySearch(searchTerm)
// console.log(data)

useEffect(() => {
if (data) {
Expand All @@ -55,7 +54,6 @@ const SearchBar = () => {
if (storedSelectedCollegeNames) {
// Parse the string back into an array
const selectedCollegeNamesArray = JSON.parse(storedSelectedCollegeNames).reverse()
console.log('selected college history', selectedCollegeNamesArray)
// Extract name and score from each object and create a new array
const selectedCollegeInfoArray = selectedCollegeNamesArray.map((college: College) => ({
name: college.name,
Expand Down
1 change: 0 additions & 1 deletion src/components/Timeline/Modals/PollModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ const PollModal = () => {
choices,
duration: pollLength,
}
console.log(poll)
}

return (
Expand Down
46 changes: 26 additions & 20 deletions src/components/atoms/LogoNavbar/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,36 +5,42 @@ import unibuzzLogo from '@assets/unibuzz_logo.svg'
import sparkles from '@assets/sparkles.svg'
import { MENU_LIST } from './constant'

export default function LogoNavbar() {
interface Props {
showOnlyLogo?: boolean
}

export default function LogoNavbar({ showOnlyLogo = false }: Props) {
return (
<div className="w-full h-[68px] px-28 mx-auto py-3 flex items-center justify-between">
<div>
<Link className="flex gap-4 center-v" href="/">
<Image src={unibuzzLogo} alt="BACPAC LOGO" width={84} height={21} className="h-full cursor-pointer" />
</Link>
</div>
<div className="flex items-center justify-between">
<div className="flex gap-16">
{MENU_LIST.map((menu, index) => {
if (menu.name === 'UPGRADE') {
{!showOnlyLogo && (
<div className="flex items-center justify-between">
<div className="flex gap-16">
{MENU_LIST.map((menu, index) => {
if (menu.name === 'UPGRADE') {
return (
<div key={index} className="flex">
<Link className="text-primary-500 text-xs" href={menu.path}>
{menu.name}
</Link>
<Image className="ml-1" src={sparkles} alt="upgrade_icon" width={20} height={20} />
</div>
)
}
return (
<div key={index} className="flex">
<Link className="text-primary-500 text-xs" href={menu.path}>
{menu.name}
</Link>
<Image className="ml-1" src={sparkles} alt="upgrade_icon" width={20} height={20} />
</div>
<Link key={index} className="text-neutral-800 text-xs" href={menu.path}>
{menu.name}
</Link>
)
}
return (
<Link key={index} className="text-neutral-800 text-xs" href={menu.path}>
{menu.name}
</Link>
)
})}
})}
</div>
{/*<LoginButton>Login</LoginButton>*/}
</div>
{/*<LoginButton>Login</LoginButton>*/}
</div>
)}
</div>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ const CommunityProfileContainer = () => {
return <PostSkeleton />
}
if (error) {
console.log(error)
return <div>Something Went Wrong!</div>
}
return userPosts?.map((post: any) => {
Expand Down
5 changes: 0 additions & 5 deletions src/services/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,14 @@ export const useHandleLogin = () => {
export const useHandleRegister = () => {
const setUserData = useUniStore((state) => state.setUserData)
const setUserProfileData = useUniStore((state) => state.setUserProfileData)
// const setToken = useUniStore((state) => state.setToken)
const [_, setCookieValue] = useCookie('uni_user_token')
const [__, setRefreshCookieValue] = useCookie('uni_user_refresh_token')

return useMutation({
mutationFn: (data: Omit<RegisterForm, 'confirmPassword' | 'tnc'>) => register(data),
onSuccess: (response: any) => {
console.log(response, 'response')
console.log(_, __)

setUserData(response.user)
setUserProfileData(response.userProfile)
// setToken(response.tokens)
setCookieValue(response.tokens.access.token, response.tokens.access.expires)
setRefreshCookieValue(response.tokens.refresh.token, response.tokens.refresh.expires)
},
Expand Down
4 changes: 1 addition & 3 deletions src/services/uploadImage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,12 @@ async function deletePreviousImage(publicId: any) {
try {
const { signature, timestamp } = generateSignature(publicId)

const res = await axios.post(`https://api.cloudinary.com/v1_1/${cloudName}/image/destroy`, {
await axios.post(`https://api.cloudinary.com/v1_1/${cloudName}/image/destroy`, {
public_id: publicId,
api_key: APIKEY,
timestamp: timestamp,
signature: signature,
})

console.log('Previous image deleted', res.data)
} catch (err) {
console.log('Error deleting previous image', err)
}
Expand Down
Loading