First shlink-frontend-kit iteration

This commit is contained in:
Alejandro Celaya
2023-07-31 21:36:44 +02:00
parent 5ec5396da6
commit 99ce8c9f74
102 changed files with 152 additions and 168 deletions

View File

@@ -1,11 +1,8 @@
import classNames from 'classnames';
import { FormGroup, Input } from 'reactstrap';
import { LabeledFormGroup, SimpleCard, ToggleSwitch, useDomId } from '../../shlink-frontend-kit/src';
import type { Settings } from '../../shlink-web-component';
import { FormText } from '../utils/forms/FormText';
import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup';
import { useDomId } from '../utils/helpers/hooks';
import { SimpleCard } from '../utils/SimpleCard';
import { ToggleSwitch } from '../utils/ToggleSwitch';
type RealTimeUpdatesProps = {
settings: Settings;

View File

@@ -1,7 +1,7 @@
import type { FC, ReactNode } from 'react';
import { Navigate, Route, Routes } from 'react-router-dom';
import { NavPillItem, NavPills } from '../../shlink-frontend-kit/src';
import { NoMenuLayout } from '../common/NoMenuLayout';
import { NavPillItem, NavPills } from '../utils/NavPills';
const SettingsSections: FC<{ items: ReactNode[] }> = ({ items }) => (
<>

View File

@@ -1,11 +1,12 @@
import type { FC, ReactNode } from 'react';
import { DropdownItem, FormGroup } from 'reactstrap';
import { DropdownBtn } from '../utils/DropdownBtn';
import { DropdownBtn, LabeledFormGroup, SimpleCard, ToggleSwitch } from '../../shlink-frontend-kit/src';
import type { Settings } from '../../shlink-web-component';
import { FormText } from '../utils/forms/FormText';
import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup';
import { SimpleCard } from '../utils/SimpleCard';
import { ToggleSwitch } from '../utils/ToggleSwitch';
import type { Settings, ShortUrlCreationSettings as ShortUrlsSettings, TagFilteringMode } from './reducers/settings';
import type { Defined } from '../utils/types';
type ShortUrlsSettings = Defined<Settings['shortUrlCreation']>;
type TagFilteringMode = Defined<ShortUrlsSettings['tagFilteringMode']>;
interface ShortUrlCreationProps {
settings: Settings;

View File

@@ -1,11 +1,12 @@
import type { FC } from 'react';
import { LabeledFormGroup, OrderingDropdown, SimpleCard } from '../../shlink-frontend-kit/src';
import type { Settings } from '../../shlink-web-component';
import { SHORT_URLS_ORDERABLE_FIELDS } from '../../shlink-web-component/short-urls/data';
import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup';
import { OrderingDropdown } from '../utils/OrderingDropdown';
import { SimpleCard } from '../utils/SimpleCard';
import type { Settings, ShortUrlsListSettings as ShortUrlsSettings } from './reducers/settings';
import type { Defined } from '../utils/types';
import { DEFAULT_SHORT_URLS_ORDERING } from './reducers/settings';
type ShortUrlsSettings = Defined<Settings['shortUrlsList']>;
interface ShortUrlsListSettingsProps {
settings: Settings;
setShortUrlsListSettings: (settings: ShortUrlsSettings) => void;

View File

@@ -1,9 +1,10 @@
import type { FC } from 'react';
import { LabeledFormGroup, OrderingDropdown, SimpleCard } from '../../shlink-frontend-kit/src';
import type { Settings } from '../../shlink-web-component';
import { TAGS_ORDERABLE_FIELDS } from '../../shlink-web-component/tags/data/TagsListChildrenProps';
import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup';
import { OrderingDropdown } from '../utils/OrderingDropdown';
import { SimpleCard } from '../utils/SimpleCard';
import type { Settings, TagsSettings as TagsSettingsOptions } from './reducers/settings';
import type { Defined } from '../utils/types';
type TagsSettingsOptions = Defined<Settings['tags']>;
interface TagsProps {
settings: Settings;

View File

@@ -1,13 +1,15 @@
import { faMoon, faSun } from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import type { FC } from 'react';
import { SimpleCard } from '../utils/SimpleCard';
import { SimpleCard, ToggleSwitch } from '../../shlink-frontend-kit/src';
import type { Settings } from '../../shlink-web-component';
import type { Theme } from '../utils/theme';
import { changeThemeInMarkup } from '../utils/theme';
import { ToggleSwitch } from '../utils/ToggleSwitch';
import type { Settings, UiSettings } from './reducers/settings';
import type { Defined } from '../utils/types';
import './UserInterfaceSettings.scss';
type UiSettings = Defined<Settings['ui']>;
interface UserInterfaceProps {
settings: Settings;
setUiSettings: (settings: UiSettings) => void;

View File

@@ -1,12 +1,10 @@
import type { FC } from 'react';
import { FormGroup } from 'reactstrap';
import { LabeledFormGroup, SimpleCard, ToggleSwitch } from '../../shlink-frontend-kit/src';
import type { Settings } from '../../shlink-web-component';
import type { DateInterval } from '../../shlink-web-component/utils/dates/helpers/dateIntervals';
import { DateIntervalSelector } from '../utils/dates/DateIntervalSelector';
import { FormText } from '../utils/forms/FormText';
import { LabeledFormGroup } from '../utils/forms/LabeledFormGroup';
import { SimpleCard } from '../utils/SimpleCard';
import { ToggleSwitch } from '../utils/ToggleSwitch';
type VisitsSettingsConfig = Settings['visits'];

View File

@@ -2,8 +2,9 @@ import type { PayloadAction, PrepareAction } from '@reduxjs/toolkit';
import { createSlice } from '@reduxjs/toolkit';
import { mergeDeepRight } from 'ramda';
import type { Settings } from '../../../shlink-web-component';
import type { Defined } from '../../utils/types';
type ShortUrlsOrder = Exclude<Exclude<Settings['shortUrlsList'], undefined>['defaultOrdering'], undefined>;
type ShortUrlsOrder = Defined<Defined<Settings['shortUrlsList']>['defaultOrdering']>;
export const DEFAULT_SHORT_URLS_ORDERING: ShortUrlsOrder = {
field: 'dateCreated',