-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
77 additions
and
45 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
ui/src/pages/Information/Npmpackages/components/Package.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { Card, Col, Skeleton, Space, Tag, Typography } from "antd"; | ||
import React from "react"; | ||
import { PackageProps } from "pages/Information/Npmpackages/utils/types"; | ||
const { Title } = Typography; | ||
import style from "pages/Information/Npmpackages/Npmpackages.module.scss"; | ||
|
||
const Package: React.FC<PackageProps> = (props) => { | ||
const onClick = (url: string) => { | ||
window.open(url, "_blank", "noopener"); | ||
}; | ||
|
||
const { version, new: status, url, key } = props.resource; | ||
|
||
return ( | ||
<Col xs={24} lg={12}> | ||
<Card onClick={() => onClick(url)}> | ||
<Skeleton loading={false}> | ||
<Space> | ||
<Title level={3}> | ||
{key}@{version} | ||
</Title> | ||
</Space> | ||
{status && ( | ||
<Tag className={style.npm__card_tag} color="#2db7f5"> | ||
NEW | ||
</Tag> | ||
)} | ||
</Skeleton> | ||
</Card> | ||
</Col> | ||
); | ||
}; | ||
|
||
export default Package; |
52 changes: 10 additions & 42 deletions
52
ui/src/pages/Information/Npmpackages/components/PackageList.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
ui/src/pages/Information/Npmpackages/components/PackageSkeleton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { Card, Col, Skeleton, Space, Typography } from "antd"; | ||
import React from "react"; | ||
|
||
const { Title } = Typography; | ||
|
||
const PackageSkeleton: React.FC = () => { | ||
return ( | ||
<Col xs={24} lg={12}> | ||
<Card> | ||
<Skeleton loading={true}> | ||
<Space> | ||
<Title level={3}>Loading...</Title> | ||
</Space> | ||
</Skeleton> | ||
</Card> | ||
</Col> | ||
); | ||
}; | ||
|
||
export default PackageSkeleton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters