Skip to content
Open
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
8 changes: 7 additions & 1 deletion libs/components/src/lib/components/AgeRestricted/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { useAccount, useAppNavigation, useAuth } from '@mezon/core';
import { selectCurrentChannelId, selectCurrentClanId } from '@mezon/store';
import { generateE2eId } from '@mezon/utils';
import { safeJSONParse } from 'mezon-js';
import { useEffect, useState } from 'react';
import { useTranslation } from 'react-i18next';
Expand Down Expand Up @@ -51,7 +52,10 @@ const AgeRestricted = ({ closeAgeRestricted }: { closeAgeRestricted: () => void
const [openModalConfirmAge, closeModalConfirmAge] = useModal(() => {
return (
<ModalLayout onClose={handleCloseModal}>
<div className="bg-theme-setting-primary pt-4 rounded flex flex-col items-center text-theme-primary w-[550px]">
<div
className="bg-theme-setting-primary pt-4 rounded flex flex-col items-center text-theme-primary w-[550px]"
data-e2e={generateE2eId('modal.birthday_confirmation')}
>
<img src={'assets/images/cake.png'} alt="warning" width={200} height={200} />
<div className="text-center ml-6 mr-6">
<h2 className="text-2xl font-bold text-center mb-4 text-theme-primary-active">{t('confirmBirthdayTitle')}</h2>
Expand All @@ -62,12 +66,14 @@ const AgeRestricted = ({ closeAgeRestricted }: { closeAgeRestricted: () => void
id="birthday"
onChange={handleBirthdayChange}
className="mb-4 px-4 py-2 mt-5 border-2 border-color-theme text-theme-message rounded-lg bg-input-secondary w-9/10"
data-e2e={generateE2eId('modal.birthday_confirmation.input.date_picker')}
/>
<div className="flex space-x-4 mb-4 w-9/10">
<button
type="button"
onClick={handleSubmit}
className="border-2 border-blue-600 rounded-lg px-6 py-2 bg-blue-600 text-white w-full"
data-e2e={generateE2eId('modal.birthday_confirmation.button.submit')}
>
{t('submit')}
</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -455,6 +455,7 @@ const BottomBlock = ({
type="checkbox"
checked={isAgeRestricted === 1}
onChange={handleCheckboxAgeRestricted}
data-e2e={generateE2eId('clan_page.channel_list.settings.overview.age_restricted.toggle')}
/>
</div>
<div className="text-theme-primary">{t('overview.ageRestricted.description')}</div>
Expand Down
16 changes: 14 additions & 2 deletions libs/utils/src/lib/e2e-testing/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,11 @@ export const DATA_E2E_IDENTIFIER = {
item: ''
},
settings: {
overview: ''
overview: {
age_restricted: {
toggle: ''
}
}
},
members: {
role: {
Expand Down Expand Up @@ -803,7 +807,15 @@ export const DATA_E2E_IDENTIFIER = {
},
search: {
input: ''
}
},
birthday_confirmation: {
input: {
date_picker: ''
},
button: {
submit: ''
}
},
},
icon: {
end_call: ''
Expand Down