Skip to content

Commit

Permalink
add icons for stylus contract files
Browse files Browse the repository at this point in the history
  • Loading branch information
tom2drum committed Dec 19, 2024
1 parent fe02c69 commit fd5f1ca
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 0 deletions.
7 changes: 7 additions & 0 deletions icons/monaco/cargo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions icons/monaco/rust.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions icons/monaco/toml.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/icons/name.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,13 @@
| "merits_with_dot"
| "merits"
| "minus"
| "monaco/cargo"
| "monaco/file"
| "monaco/folder-open"
| "monaco/folder"
| "monaco/rust"
| "monaco/solidity"
| "monaco/toml"
| "monaco/vyper"
| "moon-with-star"
| "moon"
Expand Down
12 changes: 12 additions & 0 deletions ui/shared/monaco/CodeEditorFileIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ const CodeEditorFileIcon = ({ className, fileName }: Props) => {
return 'monaco/solidity';
}

if (/.rs$/.test(fileName)) {
return 'monaco/rust';
}

if (/^Cargo\./.test(fileName)) {
return 'monaco/cargo';
}

if (/.toml$/.test(fileName)) {
return 'monaco/toml';
}

return 'monaco/file';
})();

Expand Down

0 comments on commit fd5f1ca

Please sign in to comment.