-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
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
{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
&.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 {
&::before {
background-image: url('/static/images/githug.svg');
Metadata
Metadata
Assignees
Labels
No labels