Skip to content

Commit

Permalink
style(console): update organization template layout
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyijun committed Apr 15, 2024
1 parent 622e003 commit fb4af26
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@use '@/scss/underscore' as _;

.withTable {
height: 100%;
padding-bottom: _.unit(6);
}
7 changes: 6 additions & 1 deletion packages/console/src/pages/OrganizationRoleDetails/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { withAppInsights } from '@logto/app-insights/react/AppInsightsReact';
import { type OrganizationRole } from '@logto/schemas';
import classNames from 'classnames';
import { useState } from 'react';
import { toast } from 'react-hot-toast';
import { useTranslation } from 'react-i18next';
// FIXME: @yijun

Check warning on line 7 in packages/console/src/pages/OrganizationRoleDetails/index.tsx

View workflow job for this annotation

GitHub Actions / ESLint Report Analysis

packages/console/src/pages/OrganizationRoleDetails/index.tsx#L7

[no-warning-comments] Unexpected 'fixme' comment: 'FIXME: @yijun'.
// 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 Delete from '@/assets/icons/delete.svg';
Expand All @@ -23,6 +24,7 @@ import useTenantPathname from '@/hooks/use-tenant-pathname';

import Permissions from './Permissions';
import Settings from './Settings';
import * as styles from './index.module.scss';

const orgRolesPath = `/organization-template/${OrganizationTemplateTabs.OrganizationRoles}`;

Expand All @@ -31,6 +33,8 @@ function OrganizationRoleDetails() {

const { id } = useParams();
const { navigate } = useTenantPathname();
const { pathname } = useLocation();
const isPageHasTable = pathname.endsWith(OrganizationRoleDetailsTabs.Permissions);

const { data, error, mutate, isLoading } = useSWR<OrganizationRole, RequestError>(
id && `api/organization-roles/${id}`
Expand Down Expand Up @@ -63,6 +67,7 @@ function OrganizationRoleDetails() {
backLinkTitle="organization_role_details.back_to_org_roles"
isLoading={isLoading}
error={error}
className={classNames(isPageHasTable && styles.withTable)}
onRetry={mutate}
>
<PageMeta titleKey="organization_role_details.page_title" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
@use '@/scss/underscore' as _;

.container {
height: 100%;

> *:not(:first-child) {
margin-top: _.unit(4);
}
Expand Down

0 comments on commit fb4af26

Please sign in to comment.