-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #132 from errhythm/submitModal
Add modal with guidelines to Submit দাবি
- Loading branch information
Showing
4 changed files
with
169 additions
and
24 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
120 changes: 120 additions & 0 deletions
120
apps/jonogon-web-next/src/components/custom/RegulationsModal.tsx
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,120 @@ | ||
import React, {useState, useEffect} from 'react'; | ||
import { | ||
Dialog, | ||
DialogContent, | ||
DialogDescription, | ||
DialogHeader, | ||
DialogTitle, | ||
} from '@/components/ui/dialog'; | ||
import {Button} from '@/components/ui/button'; | ||
|
||
interface RegulationsModalProps { | ||
onClose?: () => void; | ||
onAccept?: () => void; | ||
shouldShow?: boolean; | ||
} | ||
|
||
const RegulationsModal: React.FC<RegulationsModalProps> = ({ | ||
onClose, | ||
onAccept, | ||
shouldShow = true, | ||
}: RegulationsModalProps) => { | ||
const [isOpen, setIsOpen] = useState(shouldShow); | ||
|
||
useEffect(() => { | ||
setIsOpen(shouldShow); | ||
}, [shouldShow]); | ||
|
||
const handleClose = () => { | ||
setIsOpen(false); | ||
onClose?.(); | ||
}; | ||
|
||
const handleAccept = () => { | ||
setIsOpen(false); | ||
onAccept?.(); | ||
}; | ||
|
||
return ( | ||
<Dialog open={isOpen} onOpenChange={handleClose}> | ||
<DialogContent | ||
className="w-full max-w-[600px] max-h-full px-2 py-10 border-4 border-[#EF4335] bg-[#F7F2ED] !rounded-2xl overflow-y-auto" | ||
closeButton={false}> | ||
<div className="md:max-h-[calc(90vh-50px)] sm:max-h-[100vh] px-4 overflow-y-auto"> | ||
<DialogHeader className="mb-8 mt-2"> | ||
<DialogTitle className="text-black text-xl sm:text-2xl font-['Inter'] font-bold text-center leading-normal"> | ||
Rules & regulations for filing দাবিs | ||
</DialogTitle> | ||
</DialogHeader> | ||
<div> | ||
{[ | ||
{ | ||
title: 'No bullying', | ||
description: | ||
'Keep interactions constructive. Intimidation or harassment of any kind is not tolerated.', | ||
}, | ||
{ | ||
title: 'No Hate Speech', | ||
description: | ||
'Express your views respectfully. Language that promotes hatred against individuals or groups is prohibited.', | ||
}, | ||
{ | ||
title: 'No Discrimination', | ||
description: | ||
'Treat everyone equally. Discrimination based on race, gender, religion, or any other characteristic is unacceptable.', | ||
}, | ||
{ | ||
title: 'No Profanity', | ||
description: | ||
'Maintain a civil tone. Use of offensive language or explicit content is not allowed.', | ||
}, | ||
{ | ||
title: 'No Racism', | ||
description: | ||
'Embrace diversity. Racist comments or content promoting racial superiority are strictly forbidden.', | ||
}, | ||
].map((rule, index) => ( | ||
<div | ||
key={index} | ||
className="flex items-center gap-3 sm:gap-5 mb-6"> | ||
<div className="flex w-4 h-4 p-3 justify-center items-center rounded-full bg-[#EF4335] text-white text-xs sm:text-sm font-semibold font-['Inter']"> | ||
{index + 1} | ||
</div> | ||
<div> | ||
<h3 className="text-black text-base sm:text-lg font-semibold font-['Inter'] mb-1"> | ||
{rule.title} | ||
</h3> | ||
<DialogDescription className="text-[#696969] text-xs sm:text-sm font-light font-['Inter']"> | ||
{rule.description} | ||
</DialogDescription> | ||
</div> | ||
</div> | ||
))} | ||
</div> | ||
<div className="sticky bottom-0 bg-[#F7F2ED] pt-2"> | ||
<Button | ||
onClick={handleAccept} | ||
className="w-full p-6 mb-4 rounded-lg bg-[#EF4335] hover:bg-[#D93A2D] transition-colors"> | ||
<span className="text-white text-lg sm:text-xl font-bold font-['Inter']"> | ||
Accept | ||
</span> | ||
</Button> | ||
<p className="text-[#5B5B5B] font-['Inter'] text-xs sm:text-sm font-normal leading-normal"> | ||
By accepting our rules and regulations you're | ||
accepting our{' '} | ||
<a | ||
href="https://elvista.notion.site/Jonogon-962f56d9d6ea42d3839790c2146b7f6a" | ||
target="_blank" | ||
className="text-[#312C2C] font-['Inter'] text-xs sm:text-sm font-normal leading-normal underline"> | ||
Terms & Conditions | ||
</a>{' '} | ||
for behaving and acting accordingly in our platform. | ||
</p> | ||
</div> | ||
</div> | ||
</DialogContent> | ||
</Dialog> | ||
); | ||
}; | ||
|
||
export default RegulationsModal; |
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