Introduce ComponentState (#4386)

* Proof of concept ComponentState

* Migrate to createState and createFamilyState

* Refactor

* Fix

* Fix tests

* Fix lint

* Fix tests

* Re-enable coverage
This commit is contained in:
Charles Bochet
2024-03-09 11:31:00 +01:00
committed by GitHub
parent 17511be0cf
commit 86c0f311f5
451 changed files with 1718 additions and 2557 deletions

View File

@ -43,7 +43,7 @@ const StyledBenefitsContainer = styled.div`
`;
export const ChooseYourPlan = () => {
const billing = useRecoilValue(billingState);
const billing = useRecoilValue(billingState());
const [planSelected, setPlanSelected] = useState('month');

View File

@ -58,7 +58,7 @@ export const CreateProfile = () => {
const { enqueueSnackBar } = useSnackBar();
const [currentWorkspaceMember, setCurrentWorkspaceMember] = useRecoilState(
currentWorkspaceMemberState,
currentWorkspaceMemberState(),
);
const { updateOneRecord } = useUpdateOneRecord<WorkspaceMember>({

View File

@ -16,7 +16,7 @@ const StyledButtonContainer = styled.div`
`;
export const PlanRequired = () => {
const billing = useRecoilValue(billingState);
const billing = useRecoilValue(billingState());
const handleButtonClick = () => {
billing?.billingUrl && window.location.replace(billing.billingUrl);

View File

@ -10,7 +10,7 @@ import { AppPath } from '@/types/AppPath';
export const VerifyEffect = () => {
const [searchParams] = useSearchParams();
const loginToken = searchParams.get('loginToken');
const currentWorkspace = useRecoilValue(currentWorkspaceState);
const currentWorkspace = useRecoilValue(currentWorkspaceState());
const isLogged = useIsLogged();
const navigate = useNavigate();

View File

@ -21,7 +21,7 @@ const meta: Meta<PageDecoratorArgs> = {
component: CreateWorkspace,
decorators: [
(Story) => {
const setCurrentWorkspace = useSetRecoilState(currentWorkspaceState);
const setCurrentWorkspace = useSetRecoilState(currentWorkspaceState());
setCurrentWorkspace(mockedOnboardingUsersData[1].defaultWorkspace);
return <Story />;
},