diff options
| author | Armand Philippot <git@armandphilippot.com> | 2022-04-29 12:13:34 +0200 |
|---|---|---|
| committer | Armand Philippot <git@armandphilippot.com> | 2022-04-29 18:30:05 +0200 |
| commit | 7e16f500cb7bc0cfd8bafbf6bb1555704f771231 (patch) | |
| tree | bfc2b4a475cb06a787e2c4bdf284165644e82952 /src/components/Settings/AckeeSelect | |
| parent | 5324664e87bedfaa01ba62c0c847ef5b861e69b3 (diff) | |
chore: remove old pages, components, helpers and types
Since I'm using new components, I will also rewrite the GraphQL queries
so it is easier to start from scratch.
Diffstat (limited to 'src/components/Settings/AckeeSelect')
| -rw-r--r-- | src/components/Settings/AckeeSelect/AckeeSelect.module.scss | 6 | ||||
| -rw-r--r-- | src/components/Settings/AckeeSelect/AckeeSelect.tsx | 96 |
2 files changed, 0 insertions, 102 deletions
diff --git a/src/components/Settings/AckeeSelect/AckeeSelect.module.scss b/src/components/Settings/AckeeSelect/AckeeSelect.module.scss deleted file mode 100644 index b145761..0000000 --- a/src/components/Settings/AckeeSelect/AckeeSelect.module.scss +++ /dev/null @@ -1,6 +0,0 @@ -.wrapper { - display: flex; - flex-flow: row wrap; - align-items: center; - gap: var(--spacing-xs); -} diff --git a/src/components/Settings/AckeeSelect/AckeeSelect.tsx b/src/components/Settings/AckeeSelect/AckeeSelect.tsx deleted file mode 100644 index f711fe2..0000000 --- a/src/components/Settings/AckeeSelect/AckeeSelect.tsx +++ /dev/null @@ -1,96 +0,0 @@ -import { Field, Label } from '@components/FormElements'; -import Tooltip from '@components/Tooltip/Tooltip'; -import { LocalStorage } from '@services/local-storage'; -import { useAckeeTracker } from '@utils/providers/ackee'; -import { useEffect, useState } from 'react'; -import { useIntl } from 'react-intl'; -import styles from './AckeeSelect.module.scss'; - -const AckeeSelect = () => { - const intl = useIntl(); - const options = [ - { - id: 'partial', - name: intl.formatMessage({ - defaultMessage: 'Partial', - description: 'AckeeSelect: partial option name', - id: 'e/8Kyj', - }), - value: 'partial', - }, - { - id: 'full', - name: intl.formatMessage({ - defaultMessage: 'Full', - description: 'AckeeSelect: full option name', - id: 'PzRpPw', - }), - value: 'full', - }, - ]; - const [value, setValue] = useState<string>('full'); - const { setDetailed } = useAckeeTracker(); - - useEffect(() => { - setDetailed(value === 'full'); - }, [setDetailed, value]); - - useEffect(() => { - const initialState = LocalStorage.get('ackee-tracking'); - if (initialState) setValue(initialState); - }, []); - - useEffect(() => { - LocalStorage.set('ackee-tracking', `${value}`); - }, [value]); - - const label = ( - <Label - body={intl.formatMessage({ - defaultMessage: 'Tracking:', - description: 'AckeeSelect: select label', - id: '2pmylc', - })} - htmlFor="ackee-settings" - kind="settings" - /> - ); - - const message = [ - intl.formatMessage({ - defaultMessage: 'Partial includes only page url, views and duration.', - description: 'AckeeSelect: tooltip message', - id: 'skb4W5', - }), - intl.formatMessage({ - defaultMessage: - 'Full includes all information from partial as well as information about referrer, operating system, device, browser, screen size and language.', - description: 'AckeeSelect: tooltip message', - id: 'Ogccx6', - }), - ]; - - return ( - <div className={styles.wrapper}> - <Field - id="ackee-settings" - name="ackee-settings" - kind="select" - label={label} - options={options} - value={value} - setValue={setValue} - /> - <Tooltip - message={message} - title={intl.formatMessage({ - defaultMessage: 'Ackee tracking (analytics)', - description: 'AckeeSelect: tooltip title', - id: 'F1EQX3', - })} - /> - </div> - ); -}; - -export default AckeeSelect; |
