diff --git a/client/src/common/registerWizard.js b/client/src/common/registerWizard.js index 900822f01..9b48223f4 100644 --- a/client/src/common/registerWizard.js +++ b/client/src/common/registerWizard.js @@ -2,15 +2,15 @@ import intl from 'react-intl-universal'; export const getSetupWizardSteps = () => [ { - label: intl.get('Plans & Payment'), + label: intl.get('setup.plan.plans'), }, { - label: intl.get('Initializing'), + label: intl.get('setup.plan.initializing'), }, { - label: intl.get('Getting started'), + label: intl.get('setup.plan.getting_started'), }, { - label: intl.get('Congratulations'), + label: intl.get('setup.plan.congrats'), }, ]; \ No newline at end of file diff --git a/client/src/components/Alert/index.js b/client/src/components/Alert/index.js new file mode 100644 index 000000000..680f8da5a --- /dev/null +++ b/client/src/components/Alert/index.js @@ -0,0 +1,17 @@ +import React from 'react'; +import clsx from 'classnames'; + +import Style from './style.module.scss'; + +export function Alert({ title, description, intent }) { + return ( +
+ {title &&

{title}

} + {description &&

{description}

} +
+ ); +} diff --git a/client/src/components/Alert/style.module.scss b/client/src/components/Alert/style.module.scss new file mode 100644 index 000000000..be866addf --- /dev/null +++ b/client/src/components/Alert/style.module.scss @@ -0,0 +1,32 @@ +.root { + border: 1px solid rgb(223, 227, 230); + padding: 12px; + border-radius: 6px; + margin-bottom: 20px; + + &_danger { + border-color: rgb(249, 198, 198); + background: rgb(255, 248, 248); + + .description { + color: #d95759; + } + + .title { + color: rgb(205, 43, 49); + } + } +} + + +.title { + color: rgb(17, 24, 28); + margin-bottom: 4px; + font-size: 14px; + font-weight: 600; +} + +.description { + color: rgb(104, 112, 118); + margin: 0; +} \ No newline at end of file diff --git a/client/src/components/Dashboard/Dashboard.js b/client/src/components/Dashboard/Dashboard.js index 4f43bb287..5815fafab 100644 --- a/client/src/components/Dashboard/Dashboard.js +++ b/client/src/components/Dashboard/Dashboard.js @@ -12,6 +12,33 @@ import DashboardSplitPane from 'components/Dashboard/DashboardSplitePane'; import GlobalHotkeys from './GlobalHotkeys'; import DashboardProvider from './DashboardProvider'; import DrawersContainer from 'components/DrawersContainer'; +import EnsureSubscriptionIsActive from '../Guards/EnsureSubscriptionIsActive'; + +/** + * Dashboard preferences. + */ +function DashboardPreferences() { + return ( + + + + + + + ); +} + +/** + * Dashboard other routes. + */ +function DashboardAnyPage() { + return ( + + + + + ); +} /** * Dashboard page. @@ -20,19 +47,8 @@ export default function Dashboard() { return ( - - - - - - - - - - - - - + + diff --git a/client/src/components/Dashboard/DashboardContent.js b/client/src/components/Dashboard/DashboardContent.js index a783f1af3..3c75d2288 100644 --- a/client/src/components/Dashboard/DashboardContent.js +++ b/client/src/components/Dashboard/DashboardContent.js @@ -1,7 +1,7 @@ import React from 'react'; import { ErrorBoundary } from 'react-error-boundary'; import DashboardTopbar from 'components/Dashboard/DashboardTopbar'; -import DashboardContentRoute from 'components/Dashboard/DashboardContentRoute'; +import DashboardContentRoutes from 'components/Dashboard/DashboardContentRoute'; import DashboardFooter from 'components/Dashboard/DashboardFooter'; import DashboardErrorBoundary from './DashboardErrorBoundary'; @@ -10,7 +10,7 @@ export default React.forwardRef(({}, ref) => {
- +
diff --git a/client/src/components/Dashboard/DashboardContentRoute.js b/client/src/components/Dashboard/DashboardContentRoute.js index c214699c5..dfdafa711 100644 --- a/client/src/components/Dashboard/DashboardContentRoute.js +++ b/client/src/components/Dashboard/DashboardContentRoute.js @@ -2,8 +2,43 @@ import React from 'react'; import { Route, Switch } from 'react-router-dom'; import { getDashboardRoutes } from 'routes/dashboard'; +import EnsureSubscriptionsIsActive from '../Guards/EnsureSubscriptionsIsActive'; +import EnsureSubscriptionsIsInactive from '../Guards/EnsureSubscriptionsIsInactive'; import DashboardPage from './DashboardPage'; +/** + * Dashboard inner route content. + */ +function DashboardContentRouteContent({ route }) { + const content = ( + + ); + return route.subscriptionActive ? ( + + ) : route.subscriptionInactive ? ( + + ) : ( + content + ); +} + /** * Dashboard content route. */ @@ -14,21 +49,8 @@ export default function DashboardContentRoute() { {routes.map((route, index) => ( - - + + ))} diff --git a/client/src/components/Dashboard/DashboardProvider.js b/client/src/components/Dashboard/DashboardProvider.js index ee2f0ed65..6f454214f 100644 --- a/client/src/components/Dashboard/DashboardProvider.js +++ b/client/src/components/Dashboard/DashboardProvider.js @@ -1,15 +1,12 @@ import React from 'react'; import DashboardLoadingIndicator from './DashboardLoadingIndicator'; -import { useSettings } from 'hooks/query'; /** * Dashboard provider. */ export default function DashboardProvider({ children }) { - const { isLoading } = useSettings(); - return ( - + { children } ) diff --git a/client/src/components/Dashboard/DashboardTopbar.js b/client/src/components/Dashboard/DashboardTopbar.js index 74126d6db..2a4535e6a 100644 --- a/client/src/components/Dashboard/DashboardTopbar.js +++ b/client/src/components/Dashboard/DashboardTopbar.js @@ -23,6 +23,43 @@ import withSettings from 'containers/Settings/withSettings'; import QuickNewDropdown from 'containers/QuickNewDropdown/QuickNewDropdown'; import { compose } from 'utils'; +import withSubscriptions from '../../containers/Subscriptions/withSubscriptions'; + +function DashboardTopbarSubscriptionMessage() { + return ( +
+ + + +
+ ); +} + +function DashboardHamburgerButton({ ...props }) { + return ( +