Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Objects Settings - Add the "New object" button #1928

Merged
merged 3 commits into from
Oct 9, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Objects Settings - Add the "New object" button
  • Loading branch information
Abhi3685 committed Oct 8, 2023
commit c9773b56f7f11add9dbef5591c7ffaeb5cc23c32
22 changes: 21 additions & 1 deletion front/src/pages/settings/SettingsObjects.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { useNavigate } from 'react-router-dom';
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';

import { Button } from '@/ui/button/components/Button';
import {
IconBuildingSkyscraper,
IconChevronRight,
IconDotsVertical,
IconLuggage,
IconPlane,
IconPlus,
IconSettings,
IconUser,
} from '@/ui/icon';
Expand Down Expand Up @@ -52,6 +55,11 @@ const StyledIconDotsVertical = styled(IconDotsVertical)`
color: ${({ theme }) => theme.font.color.tertiary};
`;

const StyledHeader = styled.div`
display: flex;
Abhi3685 marked this conversation as resolved.
Show resolved Hide resolved
justify-content: space-between;
`;

const activeObjectItems = [
{
name: 'Companies',
Expand Down Expand Up @@ -88,11 +96,23 @@ const disabledObjectItems = [

export const SettingsObjects = () => {
const theme = useTheme();
const navigate = useNavigate();

return (
<SubMenuTopBarContainer Icon={IconSettings} title="Settings">
<StyledContainer>
<H1Title title="Objects" />
<StyledHeader>
<H1Title title="Objects" />
<Button
Icon={IconPlus}
title="New object"
accent="blue"
size="small"
onClick={() => {
navigate('/settings/objects/new');
}}
/>
</StyledHeader>
<H2Title title="Existing objects" />
<Table>
<StyledTableRow>
Expand Down