mirror of
https://github.com/logto-io/logto.git
synced 2024-12-30 20:33:54 -05:00
style(console): update organization template layout (#5713)
This commit is contained in:
parent
23714d349c
commit
3cea0735c4
3 changed files with 14 additions and 1 deletions
|
@ -0,0 +1,6 @@
|
||||||
|
@use '@/scss/underscore' as _;
|
||||||
|
|
||||||
|
.withTable {
|
||||||
|
height: 100%;
|
||||||
|
padding-bottom: _.unit(6);
|
||||||
|
}
|
|
@ -1,11 +1,12 @@
|
||||||
import { withAppInsights } from '@logto/app-insights/react/AppInsightsReact';
|
import { withAppInsights } from '@logto/app-insights/react/AppInsightsReact';
|
||||||
import { type OrganizationRole } from '@logto/schemas';
|
import { type OrganizationRole } from '@logto/schemas';
|
||||||
|
import classNames from 'classnames';
|
||||||
import { useState } from 'react';
|
import { useState } from 'react';
|
||||||
import { toast } from 'react-hot-toast';
|
import { toast } from 'react-hot-toast';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
// FIXME: @yijun
|
// FIXME: @yijun
|
||||||
// eslint-disable-next-line no-restricted-imports
|
// eslint-disable-next-line no-restricted-imports
|
||||||
import { Navigate, Route, Routes, useParams } from 'react-router-dom';
|
import { Navigate, Route, Routes, useLocation, useParams } from 'react-router-dom';
|
||||||
import useSWR, { useSWRConfig } from 'swr';
|
import useSWR, { useSWRConfig } from 'swr';
|
||||||
|
|
||||||
import Delete from '@/assets/icons/delete.svg';
|
import Delete from '@/assets/icons/delete.svg';
|
||||||
|
@ -23,6 +24,7 @@ import useTenantPathname from '@/hooks/use-tenant-pathname';
|
||||||
|
|
||||||
import Permissions from './Permissions';
|
import Permissions from './Permissions';
|
||||||
import Settings from './Settings';
|
import Settings from './Settings';
|
||||||
|
import * as styles from './index.module.scss';
|
||||||
|
|
||||||
const orgRolesPath = `/organization-template/${OrganizationTemplateTabs.OrganizationRoles}`;
|
const orgRolesPath = `/organization-template/${OrganizationTemplateTabs.OrganizationRoles}`;
|
||||||
|
|
||||||
|
@ -31,6 +33,8 @@ function OrganizationRoleDetails() {
|
||||||
|
|
||||||
const { id } = useParams();
|
const { id } = useParams();
|
||||||
const { navigate } = useTenantPathname();
|
const { navigate } = useTenantPathname();
|
||||||
|
const { pathname } = useLocation();
|
||||||
|
const isPageHasTable = pathname.endsWith(OrganizationRoleDetailsTabs.Permissions);
|
||||||
|
|
||||||
const { data, error, mutate, isLoading } = useSWR<OrganizationRole, RequestError>(
|
const { data, error, mutate, isLoading } = useSWR<OrganizationRole, RequestError>(
|
||||||
id && `api/organization-roles/${id}`
|
id && `api/organization-roles/${id}`
|
||||||
|
@ -63,6 +67,7 @@ function OrganizationRoleDetails() {
|
||||||
backLinkTitle="organization_role_details.back_to_org_roles"
|
backLinkTitle="organization_role_details.back_to_org_roles"
|
||||||
isLoading={isLoading}
|
isLoading={isLoading}
|
||||||
error={error}
|
error={error}
|
||||||
|
className={classNames(isPageHasTable && styles.withTable)}
|
||||||
onRetry={mutate}
|
onRetry={mutate}
|
||||||
>
|
>
|
||||||
<PageMeta titleKey="organization_role_details.page_title" />
|
<PageMeta titleKey="organization_role_details.page_title" />
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
@use '@/scss/underscore' as _;
|
@use '@/scss/underscore' as _;
|
||||||
|
|
||||||
.container {
|
.container {
|
||||||
|
height: 100%;
|
||||||
|
|
||||||
> *:not(:first-child) {
|
> *:not(:first-child) {
|
||||||
margin-top: _.unit(4);
|
margin-top: _.unit(4);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue