create lang selector component

pull/4179/head
Joseph Izang 1 year ago
parent ba3c6b3a26
commit c47ab0e1c8
  1. 21
      libs/remix-ui/home-tab/src/lib/components/homeTablangOptions.tsx
  2. 2
      libs/remix-ui/home-tab/src/lib/remix-ui-home-tab.tsx

@ -0,0 +1,21 @@
import React from 'react'
import { Dropdown, DropdownButton } from 'react-bootstrap'
import DropdownItem from "react-bootstrap/DropdownItem";
export function LanguageOptions() {
const langOptions = ['EN', 'ES', 'FR', 'ZH'] //get languages from locale
const changeLanguage = (e: any) => {
//change language
}
return (
<>
<div className="d-flex align-items-center justify-content-end mx-1">
<DropdownButton title="EN" id="langdropdown" size="sm">
{langOptions.map(lang => (
<DropdownItem as={'span'} onClick={changeLanguage}>{lang}</DropdownItem>
))}
</DropdownButton>
</div>
</>
)
}

@ -9,6 +9,7 @@ import HomeTabScamAlert from './components/homeTabScamAlert'
import HomeTabGetStarted from './components/homeTabGetStarted' import HomeTabGetStarted from './components/homeTabGetStarted'
import HomeTabFeatured from './components/homeTabFeatured' import HomeTabFeatured from './components/homeTabFeatured'
import HomeTabFeaturedPlugins from './components/homeTabFeaturedPlugins' import HomeTabFeaturedPlugins from './components/homeTabFeaturedPlugins'
import { LanguageOptions } from './components/homeTablangOptions'
declare global { declare global {
interface Window { interface Window {
@ -60,6 +61,7 @@ export const RemixUiHomeTab = (props: RemixUiHomeTabProps) => {
<HomeTabLearn plugin={plugin} /> <HomeTabLearn plugin={plugin} />
</div> </div>
<div className="pl-2 pr-3 justify-content-start d-flex flex-column" style={{width: '65%'}} id="remixUIHTRight"> <div className="pl-2 pr-3 justify-content-start d-flex flex-column" style={{width: '65%'}} id="remixUIHTRight">
<LanguageOptions />
<HomeTabFeatured></HomeTabFeatured> <HomeTabFeatured></HomeTabFeatured>
<HomeTabGetStarted plugin={plugin}></HomeTabGetStarted> <HomeTabGetStarted plugin={plugin}></HomeTabGetStarted>
<HomeTabFeaturedPlugins plugin={plugin}></HomeTabFeaturedPlugins> <HomeTabFeaturedPlugins plugin={plugin}></HomeTabFeaturedPlugins>

Loading…
Cancel
Save