Skip to content

Commit

Permalink
423 action settings not working (#409)
Browse files Browse the repository at this point in the history
* REMOVED TOUR PROVIDER

* Fixed action settings
  • Loading branch information
dharmesh-hemaram authored Sep 7, 2024
1 parent 41306df commit 6c84964
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 105 deletions.
14 changes: 13 additions & 1 deletion apps/acf-options-page/src/app/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useTranslation } from 'react-i18next';
import { SOCIAL_LINKS } from '../constants';
import { useAppSelector } from '../hooks';
import { appSelector } from '../store/app.slice';
import { ChatFill, Facebook, ShieldCheck, Star, Twitter, Whatsapp } from '../util';
import { ChatFill, Facebook, Github, ShieldCheck, Star, Twitter, Whatsapp, Youtube } from '../util';

function Footer() {
const { manifest } = useAppSelector(appSelector);
Expand Down Expand Up @@ -43,6 +43,18 @@ function Footer() {
{t('footer.discord')}
</a>
</li>
<li>
<a className='text-decoration-none' target='_blank' rel='noopener noreferrer' title='youtube' href={SOCIAL_LINKS.YOUTUBE}>
<Youtube className='me-2' />
{t('footer.youtube')}
</a>
</li>
<li>
<a className='text-decoration-none' target='_blank' rel='noopener noreferrer' title='github' href={SOCIAL_LINKS.GITHUB}>
<Github className='me-2' />
{t('footer.github')}
</a>
</li>
</ul>
</Col>
<Col md xs={4}>
Expand Down
38 changes: 4 additions & 34 deletions apps/acf-options-page/src/app/header.tsx
Original file line number Diff line number Diff line change
@@ -1,41 +1,25 @@
import { useTour } from '@reactour/tour';
import { useEffect, useState } from 'react';
import { Badge, Container, Nav, NavDropdown, Navbar, Offcanvas } from 'react-bootstrap';
import { useTranslation } from 'react-i18next';
import { APP_LANGUAGES, APP_LINK, SOCIAL_LINKS } from '../constants';
import { APP_LANGUAGES, APP_LINK } from '../constants';
import { useAppDispatch, useAppSelector } from '../hooks';
import { SettingsModal } from '../modal';
import { appSelector } from '../store/app.slice';
import { firebaseDatabaseSelector, firebaseSelector } from '../store/firebase';
import { switchSettingsModal } from '../store/settings/settings.slice';
import { switchTheme, themeSelector } from '../store/theme.slice';
import { GearFill, Github, Moon, Sun, ThreeDots, Youtube } from '../util';
import { GearFill, Moon, Sun, ThreeDots } from '../util';
import { HeaderGoogle } from './header_google';

function Header() {
const [show, setShow] = useState<boolean>(false);
const handleClose = () => setShow(false);
const handleShow = () => setShow(true);

const { setIsOpen } = useTour();
const theme = useAppSelector(themeSelector);
const { profile } = useAppSelector(firebaseDatabaseSelector);
const { role } = useAppSelector(firebaseSelector);
const { extensionNotFound } = useAppSelector(appSelector);
const dispatch = useAppDispatch();
const { t, i18n } = useTranslation();

useEffect(() => {
const tour = localStorage.getItem('tour');
const version = new URLSearchParams(window.location.search).get('version');
if (!tour && !version && !extensionNotFound) {
localStorage.setItem('tour', 'true');
setTimeout(() => {
setIsOpen(true);
}, 1000);
}
}, [setIsOpen, extensionNotFound]);

useEffect(() => {
if (/(DEV|BETA|LOCAL)/.test(process.env.NX_PUBLIC_VARIANT || '')) {
window.document.title = `${t('common.appName')} [${process.env.NX_PUBLIC_VARIANT}]`;
Expand Down Expand Up @@ -127,25 +111,11 @@ function Header() {
{t('footer.test')}
</Nav.Link>
</Nav.Item>
<Nav.Item as='li' className='col-6 col-lg-auto'>
<Nav.Link onClick={() => setIsOpen(true)} id='tour' title='tour'>
Tour
</Nav.Link>
</Nav.Item>
</Nav>
<hr className='d-lg-none text-white-50'></hr>
<Nav className='flex-row flex-wrap ms-md-auto' as='ul'>
<Nav.Item as='li' className='col-6 col-lg-auto'>
<Nav.Link target='_blank' rel='noopener noreferrer' title='youtube' href={SOCIAL_LINKS.YOUTUBE}>
<Youtube />
<small className='d-lg-none ms-2'>{t('footer.youtube')}</small>
</Nav.Link>
</Nav.Item>
<Nav.Item as='li' className='col-6 col-lg-auto'>
<Nav.Link target='_blank' rel='noopener noreferrer' title='github' href={SOCIAL_LINKS.GITHUB}>
<Github />
<small className='d-lg-none ms-2'>{t('footer.github')}</small>
</Nav.Link>
<Nav.Item as='li' className='col-6 col-lg-auto d-flex align-items-center'>
<iframe src='https://github.com/sponsors/Dhruv-Techapps/button' title='Sponsor Dhruv-Techapps' height='32' width='114' style={{ border: 0, borderRadius: '6px' }}></iframe>
</Nav.Item>
<Nav.Item as='li' className='py-2 py-lg-1 col-12 col-lg-auto'>
<div className='vr d-none d-lg-flex h-100 mx-lg-2 text-white'></div>
Expand Down
10 changes: 3 additions & 7 deletions apps/acf-options-page/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
import { TourProvider } from '@reactour/tour';
import * as ReactDOM from 'react-dom/client';
import { Provider } from 'react-redux';
import App from './App';
import './index.scss';
import { store } from './store';
import { steps } from './tour';
import './util/i18n';

window.EXTENSION_ID = process.env[`NX_PUBLIC_CHROME_EXTENSION_ID`] ?? '';

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement);
root.render(
<TourProvider steps={steps}>
<Provider store={store}>
<App />
</Provider>
</TourProvider>
<Provider store={store}>
<App />
</Provider>
);
4 changes: 4 additions & 0 deletions apps/acf-options-page/src/modal/action-settings.modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ const ActionSettingsModal = () => {
const update = getFieldNameValue(e, settings);
if (update) {
dispatch(updateActionSettings(update));
if (update.name === 'retryOption' && update.value === RETRY_OPTIONS.GOTO) {
const index = actions.findIndex((action) => action.id === selectedActionId);
dispatch(updateActionSettingsGoto(index === 0 ? 1 : 0));
}
}
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ActionSettings, defaultActionSettings } from '@dhruv-techapps/acf-common';
import { PayloadAction, createSlice } from '@reduxjs/toolkit';
import { RootState } from '../../../../store';
import { ActionSettings, defaultActionSettings } from '@dhruv-techapps/acf-common';
import { openActionSettingsModalAPI } from './action-settings.api';

type ActionSettingsStore = {
Expand Down
61 changes: 0 additions & 61 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
},
"dependencies": {
"@nx/devkit": "19.6.1",
"@reactour/tour": "^3.6.2",
"@reduxjs/toolkit": "^2.2.4",
"@tanstack/react-table": "^8.17.3",
"@webcomponents/webcomponentsjs": "^2.8.0",
Expand Down

0 comments on commit 6c84964

Please sign in to comment.