Repository: strapi/strapi
File: packages/core/content-releases/admin/src/pages/ReleasesSettingsPage.tsx (TypeScript)

Code before:
                    gap={6}
                    shadow="filterShadow"
                    hasRadius
                  >
                    <Typography variant="delta" tag="h2">
                      {formatMessage({
                        id: 'content-releases.pages.Settings.releases.preferences.title',
                        defaultMessage: 'Preferences',
                      })}
                    </Typography>
                    <Grid.Root>
                      <Grid.Item col={6} s={12} direction="column" alignItems="stretch">
                        <TimezoneDropdown />
                      </Grid.Item>
                    </Grid.Root>
                  </Flex>
                </Layouts.Content>
              </>
            );
          }}
        </Form>
      </Page.Main>
    </Layouts.Root>
  );
};

const TimezoneDropdown = () => {
  const permissions = useTypedSelector(
    (state) => state.admin_app.permissions['settings']?.['releases']
  );
  const {
    allowedActions: { canUpdate },
  } = useRBAC(permissions);
  const { formatMessage } = useIntl();
  const { timezoneList } = getTimezones(new Date());
  const field = useField('defaultTimezone');
  return (
    <Field.Root
      name="defaultTimezone"
      hint={formatMessage({
        id: 'content-releases.pages.Settings.releases.timezone.hint',
        defaultMessage: 'The timezone of every release can still be changed individually.',
      })}
      error={field.error}
    >
      <Field.Label>
        {formatMessage({
          id: 'content-releases.pages.Settings.releases.timezone.label',
          defaultMessage: 'Default timezone',
        })}
      </Field.Label>

Review comment (suggestion):
ℹ️ This was causing an unwanted update of the field.value whenever the text wasn't a valid value. We wanted to keep it as-is to be able to do the verification in the handleSubmit.

Code after:
                    id: 'content-releases.pages.Settings.releases.description',
                    defaultMessage: 'Create and manage content updates',
                  })}
                />
                <Layouts.Content>
                  <Flex
                    direction="column"
                    background="neutral0"
                    alignItems="stretch"
                    padding={6}
                    gap={6}
                    shadow="filterShadow"
                    hasRadius
                  >
                    <Typography variant="delta" tag="h2">
                      {formatMessage({
                        id: 'content-releases.pages.Settings.releases.preferences.title',
                        defaultMessage: 'Preferences',
                      })}
                    </Typography>
                    <Grid.Root>
                      <Grid.Item col={6} s={12} direction="column" alignItems="stretch">
                        <TimezoneDropdown />
                      </Grid.Item>
                    </Grid.Root>
                  </Flex>
                </Layouts.Content>
              </>
            );
          }}
        </Form>
      </Page.Main>
    </Layouts.Root>
  );
};

const TimezoneDropdown = () => {
  const permissions = useTypedSelector(
    (state) => state.admin_app.permissions['settings']?.['releases']
  );
  const {
    allowedActions: { canUpdate },
  } = useRBAC(permissions);
  const { formatMessage } = useIntl();
  const { timezoneList } = getTimezones(new Date());
  const field = useField('defaultTimezone');
  return (
    <Field.Root
      name="defaultTimezone"
      hint={formatMessage({
        id: 'content-releases.pages.Settings.releases.timezone.hint',