This repository has been archived by the owner on Jul 17, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
6 changed files
with
141 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import { FunctionComponent } from 'react' | ||
import CloseIcon from './alert/CloseIcon' | ||
|
||
interface Props { | ||
close: () => void | ||
} | ||
|
||
const TermsAndConditions: FunctionComponent<Props> = ({ close }) => { | ||
return ( | ||
<div className="bg-gray-300 inset-1/4 fixed text-justify rounded-md"> | ||
<div className="absolute top-0 right-0"> | ||
<CloseIcon | ||
color="text-black" | ||
onClick={() => { | ||
close() | ||
}} | ||
/> | ||
</div> | ||
<div className="p-4"> | ||
<h3 className="text-center text-2xl">Terms & Conditions</h3> | ||
Placeholder text for terms and conitions | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default TermsAndConditions |
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,23 @@ | ||
import { headers, SERVER_URL, throwOnProblem } from './useAuth' | ||
|
||
const updateTermsAndConditions = ({ | ||
id, | ||
termsAndConditionsAcceptedAt, | ||
}: { | ||
id: number | ||
termsAndConditionsAcceptedAt: Date | ||
}) => | ||
fetch(`${SERVER_URL}/user/termsandcond/${id}`, { | ||
credentials: 'include', | ||
method: 'PATCH', | ||
headers: { | ||
...headers, | ||
}, | ||
body: JSON.stringify(termsAndConditionsAcceptedAt), | ||
}).then(throwOnProblem(`Updating terms and conditions failed!`)) | ||
|
||
export const useUser = () => { | ||
return { | ||
updateTermsAndConditions, | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { FunctionComponent } from 'react' | ||
import CheckboxField from '../../components/forms/CheckboxField' | ||
|
||
interface Props { | ||
timeTcChecked: Date | null | ||
handleTcChange: () => void | ||
setShowTermsAndCond: (tc: boolean) => void | ||
} | ||
|
||
const TermsAndCondCheckbox: FunctionComponent<Props> = ({ | ||
timeTcChecked, | ||
handleTcChange, | ||
setShowTermsAndCond, | ||
}) => { | ||
return ( | ||
<div className="flex flex-row"> | ||
<CheckboxField | ||
label="" | ||
checked={timeTcChecked === null ? false : true} | ||
onChange={handleTcChange} | ||
className="cursor-pointer" | ||
/> | ||
<a | ||
className="cursor-pointer text-blue-500" | ||
onClick={() => setShowTermsAndCond(true)} | ||
> | ||
I accept terms and conditions | ||
</a> | ||
</div> | ||
) | ||
} | ||
|
||
export default TermsAndCondCheckbox |