-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add second version of Tab component
- Loading branch information
Showing
19 changed files
with
372 additions
and
161 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
module.exports = { extends: ['@commitlint/config-conventional'] }; | ||
module.exports = { | ||
extends: ['@commitlint/config-conventional'] | ||
}; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import './style.scss'; | ||
import * as React from 'react'; | ||
import { | ||
getIconForFile, | ||
getIconForFolder, | ||
getIconForOpenFolder, | ||
} from 'vscode-icons-js'; | ||
import { prefixClaName, classNames } from 'mo/common/className'; | ||
|
||
const ICON_BASE_PATH = '/assets/fileIcons/'; | ||
|
||
export interface Props { | ||
fileName: string; | ||
type?: 'folder' | 'folderOpen' | 'file'; | ||
className?: string; | ||
} | ||
|
||
export default function FileIcon({ fileName, type, className }: Props) { | ||
const iconPath: string | undefined = | ||
type === 'file' | ||
? getIconForFile(fileName) | ||
: type === 'folder' | ||
? getIconForFolder(fileName) | ||
: getIconForOpenFolder(fileName); | ||
return ( | ||
<i | ||
className={classNames(prefixClaName('file-icon'), className)} | ||
style={{ backgroundImage: `url(${ICON_BASE_PATH + iconPath})` }} | ||
/> | ||
); | ||
} |
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,11 @@ | ||
@import 'mo/style/common'; | ||
$fileIcon: 'file-icon'; | ||
|
||
#{prefix($fileIcon)} { | ||
background-position: center center; | ||
background-size: contain; | ||
display: inline-block; | ||
height: 16px; | ||
vertical-align: middle; | ||
width: 16px; | ||
} |
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
Oops, something went wrong.