-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
203 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
.debate-bar { | ||
position: relative; | ||
z-index: 0; | ||
width: 100%; | ||
height: 30px; | ||
display: flex; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export const usernameRegex = /^[a-zA-Z0-9_-]+$/ | ||
export const specialCharRegex = /[@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?]/ // eslint-disable-line | ||
export const usernameRegex = /^[a-zA-Z0-9]+$/ | ||
export const nameRegex = /^[a-zA-Z]+$/ | ||
export const emailRegex = /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+(com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|in|space)))$/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,6 @@ | |
|
||
@media screen and (max-width: 480px) { | ||
#notification { | ||
padding: 10px; | ||
padding: 20px 10px; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
import { useState } from 'react' | ||
import { useNavStore } from '../../store/useNavStore' | ||
import { ClosedDebateCard } from '../../components/card/closed-debate-card' | ||
import { OpenDebateCard } from '../../components/card/open-debate-card' | ||
|
||
interface DebatesProps { | ||
isScrollingUp: boolean | ||
} | ||
|
||
enum Tabs { | ||
Closed = 'closed-debates', | ||
Open = 'open-debates' | ||
} | ||
|
||
const UserDebates: React.FC<DebatesProps> = ({ isScrollingUp }) => { | ||
const { sidebar } = useNavStore() | ||
|
||
const [tab, setTab] = useState<Tabs>(Tabs.Closed) | ||
|
||
return ( | ||
<div> | ||
<div className={`profile-btns ${isScrollingUp ? '' : 'top'}`}> | ||
<button | ||
style={{ textDecoration: tab === Tabs.Closed ? 'underline' : '' }} | ||
onClick={() => setTab(Tabs.Closed)} | ||
> | ||
Closed Debates | ||
</button> | ||
<button | ||
style={{ textDecoration: tab === Tabs.Open ? 'underline' : '' }} | ||
onClick={() => setTab(Tabs.Open)} | ||
> | ||
Open Debates | ||
</button> | ||
</div> | ||
<div className={`debates ${sidebar ? 'column-debates' : ''}`}> | ||
{tab === Tabs.Closed ? <ClosedDebates /> : <OpenDebates />} | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
const ClosedDebates = () => { | ||
return ( | ||
<> | ||
<ClosedDebateCard /> | ||
<ClosedDebateCard /> | ||
<ClosedDebateCard /> | ||
<ClosedDebateCard /> | ||
<ClosedDebateCard /> | ||
</> | ||
) | ||
} | ||
|
||
const OpenDebates = () => { | ||
return ( | ||
<> | ||
<OpenDebateCard /> | ||
<OpenDebateCard /> | ||
<OpenDebateCard /> | ||
<OpenDebateCard /> | ||
<OpenDebateCard /> | ||
</> | ||
) | ||
} | ||
|
||
export default UserDebates |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import './style.css' | ||
import UserDebates from './debates' | ||
|
||
interface ProfileProps { | ||
isScrollingUp: boolean | ||
} | ||
|
||
export default function UserProfile({ isScrollingUp }: ProfileProps) { | ||
return ( | ||
<div id='profile'> | ||
<div className='user'> | ||
<img src='/user1.webp' alt='' /> | ||
<h1>Aniket Das</h1> | ||
<h3>@aniketdas</h3> | ||
</div> | ||
<UserDebates isScrollingUp={isScrollingUp} /> | ||
</div> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
#profile .user { | ||
padding: 20px; | ||
} | ||
|
||
#profile .user img { | ||
width: 100px; | ||
height: 100px; | ||
object-fit: cover; | ||
background-color: var(--body_background); | ||
border-radius: 10px; | ||
border: 2px solid var(--explore_input_bg); | ||
} | ||
|
||
#profile .user h3 { | ||
color: var(--card_color_secondary); | ||
} | ||
|
||
#profile .profile-btns { | ||
position: sticky; | ||
z-index: 1; | ||
top: -1px; | ||
left: 0; | ||
padding: 20px; | ||
display: flex; | ||
align-items: center; | ||
gap: 20px; | ||
background-color: var(--body_background); | ||
border-top: 1px solid var(--explore_input_bg); | ||
border-bottom: 1px solid var(--explore_input_bg); | ||
transition: top 0.25s ease-out; | ||
} | ||
|
||
#profile .profile-btns button { | ||
font-size: 18px; | ||
font-weight: 500; | ||
text-underline-offset: 4px; | ||
} | ||
|
||
#profile .profile-btns button:hover { | ||
text-decoration: underline; | ||
} | ||
|
||
@media screen and (max-width: 767px) { | ||
#profile .user img { | ||
width: 75px; | ||
height: 75px; | ||
} | ||
} | ||
|
||
@media screen and (max-width: 480px) { | ||
#profile .user { | ||
padding: 20px 10px; | ||
} | ||
|
||
#profile .user h1 { | ||
font-size: 24px; | ||
} | ||
|
||
#profile .user h3 { | ||
font-size: 16px; | ||
} | ||
|
||
#profile .profile-btns { | ||
padding: 10px; | ||
} | ||
|
||
#profile .profile-btns.top { | ||
top: -61px; | ||
transition: top 0.4s ease-out; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.