fix: replace ts icon by td and fix commonjs icon

This commit is contained in:
Juan Picado 2022-03-03 00:05:36 +01:00
parent 498afcd222
commit aa0b2aa9df
3 changed files with 17 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
'@verdaccio/ui-theme': patch
---
fix: replace ts icon by td and fix commonjs icon

View File

@ -1,4 +1,4 @@
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M0 0H36V36H0V0Z" fill="#1976D2"/>
<path d="M14.0137 12.2031V25H11.1572V12.2031H14.0137ZM17.9072 12.2031V14.4268H7.34277V12.2031H17.9072ZM25.8174 21.625C25.8174 21.4082 25.7852 21.2148 25.7207 21.0449C25.6562 20.8691 25.5391 20.708 25.3691 20.5615C25.1992 20.415 24.959 20.2686 24.6484 20.1221C24.3379 19.9697 23.9307 19.8145 23.4268 19.6562C22.8525 19.4688 22.3047 19.2578 21.7832 19.0234C21.2676 18.7832 20.8076 18.5049 20.4033 18.1885C19.999 17.8721 19.6797 17.5029 19.4453 17.0811C19.2168 16.6592 19.1025 16.167 19.1025 15.6045C19.1025 15.0596 19.2227 14.5674 19.4629 14.1279C19.7031 13.6885 20.04 13.3135 20.4736 13.0029C20.9072 12.6865 21.417 12.4463 22.0029 12.2822C22.5889 12.1123 23.2334 12.0273 23.9365 12.0273C24.874 12.0273 25.6973 12.1943 26.4062 12.5283C27.1211 12.8564 27.6777 13.3193 28.0762 13.917C28.4746 14.5088 28.6738 15.1973 28.6738 15.9824H25.8262C25.8262 15.6367 25.7529 15.332 25.6064 15.0684C25.4658 14.7988 25.249 14.5879 24.9561 14.4355C24.6689 14.2832 24.3086 14.207 23.875 14.207C23.4531 14.207 23.0986 14.2715 22.8115 14.4004C22.5303 14.5234 22.3164 14.6934 22.1699 14.9102C22.0293 15.127 21.959 15.3643 21.959 15.6221C21.959 15.8271 22.0117 16.0146 22.1172 16.1846C22.2285 16.3486 22.3867 16.5039 22.5918 16.6504C22.8027 16.791 23.0605 16.9258 23.3652 17.0547C23.6699 17.1836 24.0186 17.3066 24.4111 17.4238C25.0967 17.6406 25.7031 17.8809 26.2305 18.1445C26.7637 18.4082 27.2119 18.707 27.5752 19.041C27.9385 19.375 28.2109 19.7529 28.3926 20.1748C28.5801 20.5967 28.6738 21.0742 28.6738 21.6074C28.6738 22.1758 28.5625 22.6797 28.3398 23.1191C28.123 23.5586 27.8066 23.9336 27.3906 24.2441C26.9805 24.5488 26.4883 24.7803 25.9141 24.9385C25.3398 25.0967 24.6982 25.1758 23.9893 25.1758C23.3447 25.1758 22.709 25.0938 22.082 24.9297C21.4551 24.7598 20.8867 24.502 20.377 24.1562C19.873 23.8105 19.4688 23.3711 19.1641 22.8379C18.8652 22.2988 18.7158 21.6602 18.7158 20.9219H21.5811C21.5811 21.3086 21.6367 21.6367 21.748 21.9062C21.8594 22.1699 22.0176 22.3838 22.2227 22.5479C22.4336 22.7119 22.6885 22.8291 22.9873 22.8994C23.2861 22.9697 23.6201 23.0049 23.9893 23.0049C24.417 23.0049 24.7627 22.9463 25.0264 22.8291C25.2959 22.7061 25.4951 22.5391 25.624 22.3281C25.7529 22.1172 25.8174 21.8828 25.8174 21.625Z" fill="white"/>
<path d="M14.0137 12.2031V25H11.1572V12.2031H14.0137ZM17.9072 12.2031V14.4268H7.34277V12.2031H17.9072ZM23.374 25H20.5615L20.5791 22.7852H23.374C24.0127 22.7852 24.5518 22.6387 24.9912 22.3457C25.4307 22.0469 25.7646 21.6074 25.9932 21.0273C26.2217 20.4414 26.3359 19.7295 26.3359 18.8916V18.3027C26.3359 17.6699 26.2715 17.1133 26.1426 16.6328C26.0137 16.1465 25.8232 15.7393 25.5713 15.4111C25.3193 15.083 25.0059 14.8369 24.6309 14.6729C24.2617 14.5088 23.8369 14.4268 23.3564 14.4268H20.5088V12.2031H23.3564C24.2236 12.2031 25.0146 12.3496 25.7295 12.6426C26.4502 12.9355 27.0713 13.3545 27.5928 13.8994C28.1201 14.4443 28.5273 15.0889 28.8145 15.833C29.1016 16.5771 29.2451 17.4062 29.2451 18.3203V18.8916C29.2451 19.7998 29.1016 20.6289 28.8145 21.3789C28.5273 22.123 28.1201 22.7676 27.5928 23.3125C27.0713 23.8516 26.4531 24.2676 25.7383 24.5605C25.0234 24.8535 24.2354 25 23.374 25ZM22.1875 12.2031V25H19.3223V12.2031H22.1875Z" fill="white"/>
</svg>

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -1,5 +1,6 @@
import styled from '@emotion/styled';
import React, { useContext } from 'react';
import { ModuleType, PackageMetaInterface } from 'types/packageMeta';
import ActionBar from 'verdaccio-ui/components/ActionBar';
import Author from 'verdaccio-ui/components/Author';
import Paper from 'verdaccio-ui/components/Paper';
@ -17,6 +18,15 @@ const Dist = loadable(() => import(/* webpackChunkName: "Dist" */ './Dist'));
const Install = loadable(() => import(/* webpackChunkName: "Install" */ './Install'));
const Repository = loadable(() => import(/* webpackChunkName: "Repository" */ './Repository'));
const getModuleType = (manifest: PackageMetaInterface) => {
if (manifest.latest.main) {
return 'commonjs';
} else if (manifest.latest.type) {
return manifest.latest.type;
}
return;
};
const DetailSidebar: React.FC = () => {
const detailContext = useContext(DetailContext);
const { packageMeta, packageName, packageVersion } = detailContext;
@ -31,7 +41,7 @@ const DetailSidebar: React.FC = () => {
description={packageMeta.latest?.description}
hasTypes={typeof packageMeta.latest.types === 'string'}
isLatest={typeof packageVersion === 'undefined'}
moduleType={packageMeta.latest.type}
moduleType={getModuleType(packageMeta)}
packageName={packageName}
version={packageVersion || packageMeta.latest.version}
/>