Skip to content

Commit

Permalink
fix(web): add some missing styling (#1279)
Browse files Browse the repository at this point in the history
* comment column

* fix: filter max width

* asset and request header

* fix: asset page
  • Loading branch information
caichi-t authored Oct 23, 2024
1 parent 06366b3 commit c83a814
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 19 deletions.
2 changes: 2 additions & 0 deletions web/src/components/atoms/Icon/icons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import {
ReloadOutlined,
SortAscendingOutlined,
FilterOutlined,
CommentOutlined,
} from "@ant-design/icons";

import ArrowSquareOut from "./Icons/arrowSquareOut.svg";
Expand Down Expand Up @@ -177,4 +178,5 @@ export default {
editorCopy: EditorCopy,
circle: Circle,
rectangle: Rectangle,
comment: CommentOutlined,
};
2 changes: 2 additions & 0 deletions web/src/components/molecules/Asset/Asset/AssetBody/Asset.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ const BodyContainer = styled.div`
flex-direction: row;
width: 100%;
height: calc(100% - 72px);
border-top: 1px solid #00000008;
.ant-tree-show-line .ant-tree-switcher {
background-color: transparent;
}
Expand All @@ -239,6 +240,7 @@ const BodyWrapper = styled.div`
const SideBarWrapper = styled.div`
padding: 8px;
width: 272px;
background-color: #fafafa;
`;

const StyledButton = styled(Button)`
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import styled from "@emotion/styled";
import { CSSProperties, ReactNode } from "react";
import { ReactNode } from "react";

type Props = {
title: string;
children?: ReactNode;
style?: CSSProperties;
};

const SideBarCard: React.FC<Props> = ({ title, children, style }) => {
const SideBarCard: React.FC<Props> = ({ title, children }) => {
return (
<SideBarCardWrapper style={style}>
<SideBarCardWrapper>
<CardTitle>{title}</CardTitle>
<CardValue>{children}</CardValue>
</SideBarCardWrapper>
Expand All @@ -23,6 +22,7 @@ const SideBarCardWrapper = styled.div`
display: flex;
flex-direction: column;
box-shadow: 0 4px 4px 0 #00000025;
background-color: #fff;
`;

const CardTitle = styled.span`
Expand Down
2 changes: 1 addition & 1 deletion web/src/components/molecules/Asset/AssetList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,5 +179,5 @@ const Wrapper = styled.div`
`;

const StyledPageHeader = styled(PageHeader)`
margin: 0 8px;
border-bottom: 1px solid #00000008;
`;
8 changes: 5 additions & 3 deletions web/src/components/molecules/Common/CommentsPanel/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const CommentsPanel: React.FC<Props> = ({
trigger={<Icon icon={collapsed ? "panelToggleLeft" : "panelToggleRight"} />}>
<ContentWrapper>
{collapsed ? (
<StyledIcon icon="message" onClick={() => onCollapse(false)} />
<StyledIcon icon="comment" onClick={() => onCollapse(false)} />
) : (
<>
<ThreadWrapper>
Expand Down Expand Up @@ -72,7 +72,8 @@ const CommentsPanel: React.FC<Props> = ({
export default CommentsPanel;

const StyledIcon = styled(Icon)`
padding: 12px 20px;
padding-top: 12px;
justify-content: center;
`;

const ThreadWrapper = styled.div`
Expand All @@ -81,7 +82,8 @@ const ThreadWrapper = styled.div`
`;

const Title = styled.h3`
font-size: 18px;
font-size: 16px;
line-height: 1.5;
cursor: pointer;
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,10 @@ const StyledFormItem = styled(Form.Item)`

const TextWrapper = styled.span`
min-width: 137px;
max-width: 300px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
text-align: left;
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const FilterDropdown: React.FC<Props> = ({
<Badge offset={[-3, 3]} color="blue" dot>
<StyledButton type="text">
<Space size={10}>
{filter.title}
<Title>{filter.title}</Title>
<div onClick={remove}>
<StyledIcon icon="close" size={12} />
</div>
Expand All @@ -95,6 +95,13 @@ const StyledButton = styled(Button)`
background-color: #f8f8f8;
`;

const Title = styled.div`
max-width: 300px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
`;

const StyledIcon = styled(Icon)`
color: rgba(0, 0, 0, 0.45);
:hover {
Expand Down
23 changes: 14 additions & 9 deletions web/src/components/molecules/Content/Table/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ const ContentTable: React.FC<Props> = ({
const sharedProps = useMemo(
() => ({
menu: { items },
dropdownRender: (menu: React.ReactNode): React.ReactNode => (
dropdownRender: (menu: React.ReactNode) => (
<Wrapper>
<InputWrapper>
<Input
Expand All @@ -535,7 +535,7 @@ const ContentTable: React.FC<Props> = ({
onChange={handleChange}
/>
</InputWrapper>
{React.cloneElement(menu as React.ReactElement, { style: menuStyle })}
{React.cloneElement(menu as React.ReactElement)}
</Wrapper>
),
arrow: false,
Expand Down Expand Up @@ -710,7 +710,7 @@ const ContentTable: React.FC<Props> = ({
currentView.columns?.forEach((col, index) => {
const colKey = (metaColumn as readonly string[]).includes(col.field.type)
? col.field.type
: col.field.id ?? "";
: (col.field.id ?? "");
cols[colKey] = { show: col.visible, order: index, fixed: col.fixed };
});
return cols;
Expand Down Expand Up @@ -880,10 +880,15 @@ const Wrapper = styled.div`
0 3px 6px -4px rgba(0, 0, 0, 0.12),
0 6px 16px 0 rgba(0, 0, 0, 0.08),
0 9px 28px 8px rgba(0, 0, 0, 0.05);
.ant-dropdown-menu {
box-shadow: none;
overflow-y: auto;
max-height: 256px;
max-width: 332px;
.ant-dropdown-menu-title-content {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
`;

const menuStyle: React.CSSProperties = {
boxShadow: "none",
overflowY: "auto",
maxHeight: "256px",
};
2 changes: 1 addition & 1 deletion web/src/components/molecules/Request/List/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const Content = styled.div`
`;

const StyledPageHeader = styled(PageHeader)`
margin: 0 8px;
border-bottom: 1px solid #00000008;
`;

export default RequestListMolecule;

0 comments on commit c83a814

Please sign in to comment.