-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #483 from G-Core/WEB-5704-edit-github
Web 5704 edit GitHub
- Loading branch information
Showing
12 changed files
with
57 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
title: edit-article | ||
displayName: If you need help in proposing changes on GitHub, use the guide below: | ||
published: true | ||
--- | ||
### If you need help in proposing changes on GitHub, use the guide below: |
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
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
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
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
4 changes: 4 additions & 0 deletions
4
src/app/web-components/edit-github-button/edit-github-button.component.html
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,4 @@ | ||
<a class="edit-github-button" href="{{ articleUrl }}" target="blank"> | ||
<img class="edit-github-button-img" src="../../../assets/icons/category/edit-article-guide.svg" alt="github" /> | ||
Edit on GitHub | ||
</a> |
15 changes: 15 additions & 0 deletions
15
src/app/web-components/edit-github-button/edit-github-button.component.scss
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,15 @@ | ||
.edit-github-button { | ||
display: flex; | ||
align-items: center; | ||
gap: 0.5rem; | ||
text-decoration: none; | ||
color: #22174a; | ||
font-size: 0.875rem; | ||
line-height: 1.25rem; | ||
font-weight: 500; | ||
|
||
&-img { | ||
width: 1.5rem; | ||
height: 1.5rem; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/app/web-components/edit-github-button/edit-github-button.component.ts
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,17 @@ | ||
import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core'; | ||
import { DOCS_GITHUB_REPO } from '../../constants'; | ||
|
||
@Component({ | ||
selector: 'gc-code-block', | ||
templateUrl: './edit-github-button.component.html', | ||
styleUrls: ['./edit-github-button.component.scss'], | ||
changeDetection: ChangeDetectionStrategy.OnPush, | ||
}) | ||
export class EditGithubButtonComponent implements OnInit { | ||
public articleUrl: string = ''; | ||
|
||
public ngOnInit(): void { | ||
const prevPage = document.referrer.split('/docs/')[1]; | ||
this.articleUrl = `${DOCS_GITHUB_REPO}${prevPage}.md`; | ||
} | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.