Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Agrim/dapi547/langswitcher #35

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
45f4c70
langswitcher
May 14, 2024
e7ddbb0
mobile sidebar
May 14, 2024
dbacd7b
portugese
May 14, 2024
5b7e1c9
fixing below desktop view
May 15, 2024
f0dba40
fix styling mobile
May 15, 2024
314df2e
chevron left styling
May 15, 2024
ed47e0f
mobile fix
May 22, 2024
a4f28a3
mobile fix
May 22, 2024
e759d67
Merge remote-tracking branch 'upstream/feature/integrate-translations…
May 23, 2024
d86343c
lang fix
May 23, 2024
6d0d1a5
chore: language switcher
shafin-deriv May 23, 2024
f15e588
styling changes
May 27, 2024
f11ca29
url fix
May 28, 2024
61c982a
url fix
May 28, 2024
eae951a
url issue
May 28, 2024
c639a14
Language Fix
May 28, 2024
9db8f0c
replacing to en language
May 28, 2024
1076761
clean code and styling fix
May 29, 2024
d50ca3e
styling changes dropdown
May 29, 2024
4ad9e43
language switcher fix
May 29, 2024
957d590
trailing slash
Jun 4, 2024
4bfaea9
build fix
Jun 4, 2024
1ae55ac
revert docusaurus change and add trailing slash manually
Jun 4, 2024
a4224c8
url fix
Jun 4, 2024
a42343b
docusuarus
Jun 4, 2024
8322d90
revert change pull from master
Jun 5, 2024
1ba3eb6
same changes for mobile
Jun 5, 2024
06d77a8
replace push by replace
Jun 6, 2024
270dd3c
console log to check error in test link
Jun 6, 2024
f75340d
console lkog
Jun 6, 2024
420d150
D
Jun 6, 2024
7c665d1
check
Jun 6, 2024
07dda1e
check
Jun 6, 2024
1689dd7
testing
Jun 6, 2024
a64d942
remove logic of shift and unshift
Jun 6, 2024
71e8459
fixes desktop and mobile
Jun 7, 2024
c4c8acc
no need of trailing slash from docusaurus
Jun 7, 2024
5e100cc
remove trailing slash from docusaurus
Jun 7, 2024
207cfd1
revert test
Jun 7, 2024
45af153
revert test
Jun 7, 2024
d4dceda
fix: language modal flicker issue
shafin-deriv Jun 11, 2024
34d5dd7
chore: align with master
shafin-deriv Jun 11, 2024
54baf14
Merge branch 'feature/integrate-translations' into Agrim/DAPI547/lang…
agrim-deriv Jun 11, 2024
3cc470d
chore: update css
shafin-deriv Jun 11, 2024
780f6fe
Merge branch 'Agrim/DAPI547/langswitcher' of https://github.com/agrim…
agrim-deriv Jun 11, 2024
99edb26
langauges on right
agrim-deriv Jun 11, 2024
44271d1
fix: login using another language
agrim-deriv Jun 12, 2024
3e03938
fix: login using another language
agrim-deriv Jun 12, 2024
6284d2a
fix: auth url fix
agrim-deriv Jun 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const config = {
// If you aren't using GitHub pages, you don't need these.
organizationName: 'binary-com', // Usually your GitHub org/user name.
projectName: 'deriv-api-docs', // Usually your repo name.
trailingSlash: false,

customFields: {
trackJsToken: process.env.TRACKJS_TOKEN,
Expand All @@ -28,7 +27,7 @@ const config = {
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en', 'es', 'fr'],
locales: ['en', 'es', 'fr', 'pt'],
localeConfigs: {
en: {
label: 'English',
Expand Down Expand Up @@ -124,6 +123,10 @@ const config = {
type: 'custom-user-navbar-item',
position: 'right',
},
{
type: 'localeDropdown',
position: 'right',
},
],
},
prism: {
Expand Down
2 changes: 1 addition & 1 deletion i18n/pt/docusaurus-plugin-content-docs/current/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ keywords:
description: Obtenha uma visão geral dos exemplos de código e linguagens da API Deriv disponíveis e como utilizá-la para criar a sua aplicação de negociação.
---

importar RenderOfficialContents de '@site/src/components/RenderOfficialContents';
import RenderOfficialContents from '@site/src/components/RenderOfficialContents';

A nossa Documentação está dividida em diferentes secções:

Expand Down
3,650 changes: 1,275 additions & 2,375 deletions package-lock.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
},
"dependencies": {
"@deriv/deriv-api": "^1.0.11",
"@deriv/quill-icons": "^1.22.7",
"@deriv/ui": "^0.8.0",
"@docusaurus/core": "^3.3.2",
"@docusaurus/plugin-client-redirects": "^3.3.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
width: rem(1.5);
height: rem(1.5);
transform: rotate(0deg);
transition: transform .2s ease-in-out;
transition: transform 0.2s ease-in-out;
}
}

Expand Down
88 changes: 44 additions & 44 deletions src/components/CustomCheckbox/custom_checkbox.module.scss
Original file line number Diff line number Diff line change
@@ -1,50 +1,50 @@
@use 'src/styles/utility' as *;

.customCheckboxContainer {
display: flex;
justify-content: center;
display: flex;
justify-content: center;
position: relative;
min-width: rem(1.6);
padding-top: rem(0.8);
z-index: 0;
margin-bottom: auto;
@media screen and (min-width: 992px) {
align-items: center;
}
label {
cursor: pointer;
margin-left: rem(1.5);
}
.checkboxContainer {
position: relative;
width: rem(1.5);
height: rem(1.5);
}
.customCheckbox {
position: absolute;
background-repeat: no-repeat;
display: inline-block;
border: 2px solid var(--ifm-color-emphasis-500);
min-width: rem(1.6);
padding-top: rem(0.8);
z-index: 0;
margin-bottom: auto;
@media screen and (min-width: 992px) {
align-items: center;
height: rem(1.6);
border-radius: 2px;
transition: background-color 0.25s, border-color 0.25s;
z-index: 1;
}
input {
// The original checkbox has to be hidden, but still be clickable
// Hence, opacity 0 is used instead of visibility or display
cursor: pointer;
opacity: 0;
z-index: 2;
width: rem(1.5);
height: rem(1.5);
position: absolute;
&:checked + .customCheckbox {
background-image: url(/img/check.svg);
background-position: center;
background-color: var(--colors-coral500);
border-color: var(--colors-coral500);
}
label {
cursor: pointer;
margin-left: rem(1.5);
}
.checkboxContainer {
position: relative;
width: rem(1.5);
height: rem(1.5);
}
.customCheckbox {
position: absolute;
background-repeat: no-repeat;
display: inline-block;
border: 2px solid var(--ifm-color-emphasis-500);
min-width: rem(1.6);
height: rem(1.6);
border-radius: 2px;
transition: background-color 0.25s, border-color 0.25s;
z-index: 1;
}
input {
// The original checkbox has to be hidden, but still be clickable
// Hence, opacity 0 is used instead of visibility or display
cursor: pointer;
opacity: 0;
z-index: 2;
width: rem(1.5);
height: rem(1.5);
position: absolute;
&:checked + .customCheckbox {
background-image: url(/img/check.svg);
background-position: center;
background-color: var(--colors-coral500);
border-color: var(--colors-coral500);
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
@use 'src/styles/utility' as *;

.selectedAccount {
display: flex;
height: 100%;
align-items: center;
.accountInfoContainer {
display: flex;
height: 100%;
align-items: center;
.accountInfoContainer {
display: flex;
flex-direction: column;
margin-left: rem(1);
.accountType {
font-size: rem(1.6);
}
.accountId {
font-size: rem(1.2);
color: var(--ifm-color-emphasis-700);
}
flex-direction: column;
margin-left: rem(1);
.accountType {
font-size: rem(1.6);
}
div {
line-height: initial;
.accountId {
font-size: rem(1.2);
color: var(--ifm-color-emphasis-700);
}
img {
width: rem(2.4);
height: rem(2.4);
}
}
}
div {
line-height: initial;
}
img {
width: rem(2.4);
height: rem(2.4);
}
}
50 changes: 25 additions & 25 deletions src/components/CustomSelectDropdown/custom_select_item.module.scss
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
@use 'src/styles/utility' as *;

.customSelectItem {
display: flex;
width: 100%;
align-items: center;
font-size: rem(1.4);
transition: background-color 0.2s;
border-radius: 3px;
padding: rem(1);
height: rem(5.2);
line-height: rem(2);

&:hover {
cursor: pointer;
background-color: var(--ifm-color-emphasis-100);
}
img {
width: rem(3.2);
height: rem(3.2);
}
.accountInfoContainer {
display: flex;
width: 100%;
align-items: center;
font-size: rem(1.4);
transition: background-color 0.2s;
border-radius: 3px;
padding: rem(1);
height: rem(5.2);
flex-direction: column;
margin-left: rem(1);
line-height: rem(2);

&:hover {
cursor: pointer;
background-color: var(--ifm-color-emphasis-100);
}
img {
width: rem(3.2);
height: rem(3.2);
}
.accountInfoContainer {
display: flex;
flex-direction: column;
margin-left: rem(1);
line-height: rem(2);
.accountId {
font-size: rem(1);
color: var(--ifm-color-emphasis-600);
}
.accountId {
font-size: rem(1);
color: var(--ifm-color-emphasis-600);
}
}
}
30 changes: 15 additions & 15 deletions src/components/NavbarSeparator/NavbarSeparator.module.scss
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
@use 'src/styles/utility' as *;

.separatorContainer {
display: flex;
height: 100%;
padding: 0 rem(1.6);
align-items: center;
justify-content: center;
.navbarSeparator {
display: inline-block;
height: rem(3.2);
width: 1px;
background-color: var(--ifm-color-emphasis-300);
}
@media (max-width: 1200px) {
display: none;
}
}
display: flex;
height: 100%;
padding: 0 rem(1.6);
align-items: center;
justify-content: center;
.navbarSeparator {
display: inline-block;
height: rem(3.2);
width: 1px;
background-color: var(--ifm-color-emphasis-300);
}
@media (max-width: 1200px) {
display: none;
}
}
14 changes: 7 additions & 7 deletions src/components/SearchButton/SearchButton.module.scss
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@use 'src/styles/utility' as *;

.searchButton {
width: rem(2.4);
height: rem(2.4);
background-image: url('/img/search-bold.svg');
background-repeat: no-repeat;
background-size: rem(1.6) rem(1.6);
background-position: center;
cursor: pointer;
width: rem(2.4);
height: rem(2.4);
background-image: url('/img/search-bold.svg');
background-repeat: no-repeat;
background-size: rem(1.6) rem(1.6);
background-position: center;
cursor: pointer;
}
16 changes: 13 additions & 3 deletions src/components/SkeletonText/SkeletonText.module.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
@use 'src/styles/utility' as *;

.skeleton {
background-image: linear-gradient(to right, var(--ifm-color-emphasis-0), var(--ifm-color-emphasis-100), var(--ifm-color-emphasis-200));
background-image: linear-gradient(
to right,
var(--ifm-color-emphasis-0),
var(--ifm-color-emphasis-100),
var(--ifm-color-emphasis-200)
);
padding: rem(1);
height: rem(2);
margin-bottom: rem(1.6);
Expand All @@ -10,8 +15,13 @@
}

.skeleton:before {
content: " ";
background-image: linear-gradient(to right, var(--ifm-color-emphasis-200), var(--ifm-color-emphasis-100), var(--ifm-color-emphasis-0));
content: ' ';
background-image: linear-gradient(
to right,
var(--ifm-color-emphasis-200),
var(--ifm-color-emphasis-100),
var(--ifm-color-emphasis-0)
);
width: 100%;
height: 100%;
display: inline-block;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Spinner/Spinner.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
overflow: hidden;
animation: rotating 0.5s linear infinite;
&:before {
content: "";
content: '';
left: 50%;
top: 50%;
width: 70%;
Expand Down
2 changes: 1 addition & 1 deletion src/components/UserNavbarItem/UserNavbarItem.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
background-color: var(--colors-coral500);
border-radius: 16px;
padding: rem(1) rem(1.6);
transition: background-color .2s;
transition: background-color 0.2s;
font-size: rem(1.4);
&:hover {
color: var(--ifm-color-emphasis-0);
Expand Down
7 changes: 5 additions & 2 deletions src/components/UserNavbarItem/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
import useAuthContext from '@site/src/hooks/useAuthContext';
import useLoginUrl from '@site/src/hooks/useLoginUrl';
import useLogout from '@site/src/hooks/useLogout';
Expand All @@ -10,13 +11,15 @@ interface IProps {

const UserNavbarItem = ({ mobile }: IProps) => {
const [authUrl, setAuthUrl] = useState<string>('');

const {
i18n: { currentLocale },
} = useDocusaurusContext();
const { is_logged_in } = useAuthContext();
const { logout } = useLogout();
const { getUrl } = useLoginUrl();

useEffect(() => {
const url = getUrl('en');
const url = getUrl(currentLocale);
setAuthUrl(url);
}, [getUrl]);

Expand Down
Loading