Skip to content

Commit

Permalink
refactor: add icons dir
Browse files Browse the repository at this point in the history
- Added Icons directory for static icons
- Added the BlueFolderIcon component in this Icons directory since it
  was already being used in Build, Tests and Issue Details pages
  • Loading branch information
murilx committed Jan 22, 2025
1 parent d74eeb3 commit f08c16e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
8 changes: 3 additions & 5 deletions dashboard/src/components/BuildDetails/BuildDetails.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ImTree } from 'react-icons/im';

import { MdClose, MdCheck, MdFolderOpen } from 'react-icons/md';
import { MdClose, MdCheck } from 'react-icons/md';

import { useIntl } from 'react-intl';
import { ErrorBoundary } from 'react-error-boundary';
Expand Down Expand Up @@ -41,11 +41,9 @@ import { getFilesSection } from '@/components/Section/FilesSection';
import QuerySwitcher from '@/components/QuerySwitcher/QuerySwitcher';
import { MemoizedSectionError } from '@/components/DetailsPages/SectionError';

import BuildDetailsTestSection from './BuildDetailsTestSection';
import { BlueFolderIcon } from '@/components/Icons/BlueFolder';

const BlueFolderIcon = (): JSX.Element => (
<MdFolderOpen className="text-blue" />
);
import BuildDetailsTestSection from './BuildDetailsTestSection';

interface BuildDetailsProps {
breadcrumb?: JSX.Element;
Expand Down
5 changes: 5 additions & 0 deletions dashboard/src/components/Icons/BlueFolder.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { MdFolderOpen } from 'react-icons/md';

export const BlueFolderIcon = (): JSX.Element => (
<MdFolderOpen className="text-blue" />
);
8 changes: 2 additions & 6 deletions dashboard/src/components/Section/MiscSection.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { type Dispatch, type SetStateAction } from 'react';

import { MdFolderOpen } from 'react-icons/md';

import type {
IJsonContent,
SheetType,
Expand All @@ -13,11 +11,9 @@ import { TruncatedValueTooltip } from '@/components/Tooltip/TruncatedValueToolti

import { SheetTrigger } from '@/components/Sheet';

import type { ISection, SubsectionLink } from './Section';
import { BlueFolderIcon } from '@/components/Icons/BlueFolder';

const BlueFolderIcon = (): JSX.Element => (
<MdFolderOpen className="text-blue" />
);
import type { ISection, SubsectionLink } from './Section';

export const getMiscSection = ({
misc,
Expand Down
6 changes: 2 additions & 4 deletions dashboard/src/components/TestDetails/TestDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { useCallback, useMemo, useState } from 'react';
import type { Dispatch, SetStateAction } from 'react';

import { PiComputerTowerThin } from 'react-icons/pi';
import { MdFolderOpen } from 'react-icons/md';

import { Link, useRouterState, useSearch } from '@tanstack/react-router';

Expand Down Expand Up @@ -34,6 +33,7 @@ import { getFilesSection } from '@/components/Section/FilesSection';
import { TruncatedValueTooltip } from '@/components/Tooltip/TruncatedValueTooltip';
import QuerySwitcher from '@/components/QuerySwitcher/QuerySwitcher';
import { MemoizedSectionError } from '@/components/DetailsPages/SectionError';
import { BlueFolderIcon } from '@/components/Icons/BlueFolder';

const TestDetailsSections = ({
test,
Expand Down Expand Up @@ -115,9 +115,7 @@ const TestDetailsSections = ({
},
{
title: 'global.logs',
icon: hasUsefulLogInfo ? (
<MdFolderOpen className="text-blue" />
) : undefined,
icon: hasUsefulLogInfo ? <BlueFolderIcon /> : undefined,
linkText: shouldTruncate(valueOrEmpty(test.log_url)) ? (
<TruncatedValueTooltip value={test.log_url} isUrl={true} />
) : (
Expand Down

0 comments on commit f08c16e

Please sign in to comment.