Скорректировал счетчик посетителей
This commit is contained in:
parent
95c7b64d4c
commit
18762aaaaf
10 changed files with 770 additions and 17 deletions
|
|
@ -45,6 +45,7 @@ export default function CommentForm(props: CommentFormProps) {
|
|||
const [errors, setErrors] = createSignal<ValidationErrors>({});
|
||||
const [touched, setTouched] = createSignal<{ [key: string]: boolean }>({});
|
||||
const [showEmojiPicker, setShowEmojiPicker] = createSignal(false);
|
||||
const [consent, setConsent] = createSignal(false);
|
||||
|
||||
const sanitizeInput = (input: string): string => {
|
||||
return input
|
||||
|
|
@ -124,7 +125,7 @@ export default function CommentForm(props: CommentFormProps) {
|
|||
};
|
||||
|
||||
const isValid = () => {
|
||||
return !errors().content && content().trim();
|
||||
return !errors().content && content().trim() && consent();
|
||||
};
|
||||
|
||||
return (
|
||||
|
|
@ -213,6 +214,19 @@ export default function CommentForm(props: CommentFormProps) {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-3 pt-2 pb-2">
|
||||
<input
|
||||
type="checkbox"
|
||||
id="comment-consent"
|
||||
checked={consent()}
|
||||
onChange={(e) => setConsent(e.currentTarget.checked)}
|
||||
class="w-4 h-4 accent-blue-600 cursor-pointer"
|
||||
/>
|
||||
<label for="comment-consent" class="text-sm text-gray-600 cursor-pointer">
|
||||
Я согласен на <a href="/privacy" class="text-blue-600 hover:underline">обработку персональных данных</a>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 pt-2">
|
||||
<p class="text-sm text-gray-500">
|
||||
{props.user
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue