* fix: create useAuthorizedSettingsConfig * use config to render routes * translations and icon * mount in CommandBar * memo * Update app/hooks/useSettingsAction.tsx Co-authored-by: Tom Moor <tom.moor@gmail.com> * fix: add actions into settings action * remove comment * fix: update shares * fix: Remove Slack/Zapier from translations Co-authored-by: Tom Moor <tom.moor@gmail.com>
25 lines
695 B
TypeScript
25 lines
695 B
TypeScript
import * as React from "react";
|
|
import { Switch, Redirect } from "react-router-dom";
|
|
import Route from "~/components/ProfiledRoute";
|
|
import useAuthorizedSettingsConfig from "~/hooks/useAuthorizedSettingsConfig";
|
|
|
|
export default function SettingsRoutes() {
|
|
const configs = useAuthorizedSettingsConfig();
|
|
|
|
return (
|
|
<Switch>
|
|
{configs.map((config) => (
|
|
<Route
|
|
exact
|
|
key={config.path}
|
|
path={config.path}
|
|
component={config.component}
|
|
/>
|
|
))}
|
|
{/* old routes */}
|
|
<Redirect from="/settings/import-export" to="/settings/export" />
|
|
<Redirect from="/settings/people" to="/settings/members" />
|
|
</Switch>
|
|
);
|
|
}
|