Open dan2k3k4 opened 5 months ago
This is just a suggestion and doesn't need to be taken seriously 😅.
We can detect the type of version control system and output a better icon e.g. for GitHub, BitBucket, GitLab, with fallback to default icon as GitLab.
In src/components/ProjectDetailsSidebar/StyledProjectSidebar.tsx - we output .source class for gitBranchLink
src/components/ProjectDetailsSidebar/StyledProjectSidebar.tsx
.source
gitBranchLink
{gitBranchLink ? ( <div className="field-wrapper source">
We could adapt this to output a class based on the detected Git URL, e.g.
const isGitHub = () => { const patternGitHub = '(?:git|https?|git@)(?:\\:\\/\\/)?github.com[/|:][A-Za-z0-9-]+?\\/[\\w\\.-]+?\\.git(?:\\/?|\\#[\\w\\.\\-_]+)?$'; return new RegExp(patternGitHub).test(gitBranchLink); }
In src/components/Environment/StyledEnvironment.tsx and a few other files, we basically hardcode the icon to always output the git-lab.svg
src/components/Environment/StyledEnvironment.tsx
git-lab.svg
&.source { &::before { background-image: url('/static/images/git-lab.svg');
So we would need more classes for e.g. &.source-github and ensure github.svg exists as a file in static/images folder, e.g.
&.source-github
github.svg
static/images
&.source-github { &::before { background-image: url('/static/images/githug.svg');
This is pretty good!
This is just a suggestion and doesn't need to be taken seriously 😅.
We can detect the type of version control system and output a better icon e.g. for GitHub, BitBucket, GitLab, with fallback to default icon as GitLab.
In
src/components/ProjectDetailsSidebar/StyledProjectSidebar.tsx
- we output.source
class forgitBranchLink
We could adapt this to output a class based on the detected Git URL, e.g.
In
src/components/Environment/StyledEnvironment.tsx
and a few other files, we basically hardcode the icon to always output thegit-lab.svg
So we would need more classes for e.g.
&.source-github
and ensuregithub.svg
exists as a file instatic/images
folder, e.g.