Skip to content

Commit

Permalink
feat: add new drawer for files review
Browse files Browse the repository at this point in the history
  • Loading branch information
nyqykk committed Dec 23, 2024
1 parent 1574432 commit ea53c19
Show file tree
Hide file tree
Showing 18 changed files with 247 additions and 93 deletions.
5 changes: 5 additions & 0 deletions packages/components/src/common/svg/file-css.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions packages/components/src/common/svg/file-html.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions packages/components/src/common/svg/file-image.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions packages/components/src/common/svg/file-js.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions packages/components/src/common/svg/file-unknown.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

.arrow {
position: relative;
top: 8px;
left: 50%;
transform: translateX(-50%) rotate(90deg);
color: #2994ff;
}
2 changes: 0 additions & 2 deletions packages/components/src/components/Alert/package-relation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ export const PackageRelationReasons: React.FC<{
data: SDK.ServerAPI.InferResponseType<SDK.ServerAPI.API.GetPackageRelationAlertDetails>;
cwd: string;
}> = ({ data }) => {
const [index, setIndex] = useState(0);

return (
<Row gutter={Size.BasePadding} wrap={false} align="top">
<Col span={20} style={{ height: '100%' }}>
Expand Down
6 changes: 5 additions & 1 deletion packages/components/src/components/Alerts/bundle-alert.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Typography, Tabs } from 'antd';
import { Typography, Tabs, Empty } from 'antd';
import { Rule } from '@rsdoctor/types';

import { Card } from '../Card';
Expand Down Expand Up @@ -90,6 +90,10 @@ export const BundleAlert: React.FC<BundleAlertProps> = ({
break;
}

if (!td.data.length) {
children = <Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />;
}

return {
key: td.key,
label: <LabelComponent />,
Expand Down
40 changes: 17 additions & 23 deletions packages/components/src/components/Alerts/list.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,22 @@ import styles from './list.module.scss';

export const CommonList = (props: { data: Array<Rule.RuleStoreDataItem> }) => {
const { data } = props;
return data.length ? (
data.map((d) => {
const { code, link, description } = d;
const navigate = useRuleIndexNavigate(code, link);
return data.map((d) => {
const { code, link, description } = d;
const navigate = useRuleIndexNavigate(code, link);

return (
<Overview
style={{
background: '#fff',
}}
description={
<span className={styles.description}>{description}</span>
}
icon={
<Button onClick={() => navigate} type="link">
more
</Button>
}
/>
);
})
) : (
<Empty image={Empty.PRESENTED_IMAGE_SIMPLE} />
);
return (
<Overview
style={{
background: '#fff',
}}
description={<span className={styles.description}>{description}</span>}
icon={
<Button onClick={() => navigate} type="link">
more
</Button>
}
/>
);
});
};
Loading

0 comments on commit ea53c19

Please sign in to comment.