diff --git a/src/locale/en.json b/src/locale/en.json index a2ddb48d..d1313677 100644 --- a/src/locale/en.json +++ b/src/locale/en.json @@ -68,5 +68,6 @@ "mr_meir": "Mr. Asher Meir", "innovation_authority": "Innovation Authority", "migdal_company": "\"A tower in the community\"", - "and_smaller_donors": "And other small contributions from my friends and fans of the workshop." + "and_smaller_donors": "And other small contributions from my friends and fans of the workshop.", + "github_link": "Go to GitHub" } diff --git a/src/locale/he.json b/src/locale/he.json index f9647fc0..d788d706 100644 --- a/src/locale/he.json +++ b/src/locale/he.json @@ -68,5 +68,7 @@ "innovation_authority": "רשות החדשנות", "migdal_company": "“מגדל בקהילה“", "and_smaller_donors": "ותרומות קטנות נוספות של ידידי ואוהדי הסדנא.", - "gaps_patterns_page_title": "דפוסי נסיעות שלא יצאו" + "gaps_patterns_page_title": "דפוסי נסיעות שלא יצאו", + "github_link": "למעבר אל GitHub" + } diff --git a/src/pages/components/header/sidebar/GitHubLink/GitHubLink.scss b/src/pages/components/header/sidebar/GitHubLink/GitHubLink.scss new file mode 100644 index 00000000..abc983ee --- /dev/null +++ b/src/pages/components/header/sidebar/GitHubLink/GitHubLink.scss @@ -0,0 +1,12 @@ +.github-link { + display: flex; + justify-content: center; + align-items: center; + font-size: 2em; + cursor: pointer; + + + &:hover { + transform: scale(1.1); + } +} diff --git a/src/pages/components/header/sidebar/GitHubLink/GitHubLink.tsx b/src/pages/components/header/sidebar/GitHubLink/GitHubLink.tsx new file mode 100644 index 00000000..fcf34d26 --- /dev/null +++ b/src/pages/components/header/sidebar/GitHubLink/GitHubLink.tsx @@ -0,0 +1,26 @@ +import React from 'react' +import { GithubOutlined } from '@ant-design/icons' +import { TEXT_KEYS } from 'src/resources/texts' +import { useTranslation } from 'react-i18next' +import './GitHubLink.scss' + +export default function GitHubLink() { + const { t } = useTranslation() + + const data = { + label: t(TEXT_KEYS.github_link), + path: 'https://github.com/hasadna/open-bus-map-search', + icon: , + element: null, + } + + const handleClick = () => { + window.open(data.path, '_blank') + } + + return ( +
+ {data.icon} +
+ ) +} diff --git a/src/pages/components/header/sidebar/SideBar.tsx b/src/pages/components/header/sidebar/SideBar.tsx index a58ace33..18885514 100644 --- a/src/pages/components/header/sidebar/SideBar.tsx +++ b/src/pages/components/header/sidebar/SideBar.tsx @@ -3,6 +3,7 @@ import './sidebar.scss' import { Drawer } from 'antd' import { useContext } from 'react' import { LayoutContextInterface, LayoutCtx } from 'src/layout/LayoutContext' +import GitHubLink from './GitHubLink/GitHubLink' const Logo = () => (
@@ -22,11 +23,18 @@ export default function SideBar() { onClose={() => setDrawerOpen(false)} open={drawerOpen} className="hideOnDesktop"> + +
+
+ ) diff --git a/src/pages/components/header/sidebar/sidebar.scss b/src/pages/components/header/sidebar/sidebar.scss index a72c187e..b3af711f 100644 --- a/src/pages/components/header/sidebar/sidebar.scss +++ b/src/pages/components/header/sidebar/sidebar.scss @@ -95,4 +95,15 @@ border-bottom: 8px solid gray; padding-bottom: 0; line-height: 25px; +} + +.sidebar-section { + display: flex; + flex-direction: column; +} + +.sidebar-divider { + height: 1px; + background-color: #ccc; + margin: 8px 0; } \ No newline at end of file diff --git a/src/resources/texts.tsx b/src/resources/texts.tsx index 7d6d8dd9..2af6b4d9 100644 --- a/src/resources/texts.tsx +++ b/src/resources/texts.tsx @@ -74,6 +74,7 @@ export const TEXT_KEYS = { migdal_company: 'migdal_company', and_smaller_donors: 'and_smaller_donors', gaps_patterns_page_title: 'gaps_patterns_page_title', + github_link: 'github_link', } export const TEXTS = { @@ -179,6 +180,7 @@ export const TEXTS = { show_document: 'הצג מידע לגיקים', bearing: 'מעלות', kmh: 'קמ״ש', + github_link: 'github_link', } export const formatted = (text: string, value: string) => text.replace(PLACEHOLDER, value)