generated from damla/nextjs-dApp-starter
-
Notifications
You must be signed in to change notification settings - Fork 2
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 #19 from damla/dev
- Loading branch information
Showing
15 changed files
with
139 additions
and
78 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
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
55 changes: 55 additions & 0 deletions
55
src/components/common/LanguageSelector/LanguageSelector.tsx
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,55 @@ | ||
import { Menu, Transition } from '@headlessui/react'; | ||
import { ChevronUpIcon } from '@heroicons/react/solid'; | ||
import Link from 'next/link'; | ||
import { Fragment } from 'react'; | ||
|
||
const LanguageSelector = () => { | ||
// const [selectedLang, setSelectedLang] = useState([ | ||
// { value: 'en', label: 'English', current: true }, | ||
// { value: 'tr', label: 'Turkish', current: false }, | ||
// ]); | ||
|
||
return ( | ||
<div className="w-28 text-left"> | ||
<Menu as="div" className="relative inline-block text-left"> | ||
<Menu.Button className="inline-flex justify-center w-full px-4 py-2 text-sm font-medium text-white bg-black rounded-md bg-opacity-20 hover:bg-opacity-30 focus:outline-none focus-visible:ring-2 focus-visible:ring-white focus-visible:ring-opacity-75"> | ||
Languages | ||
<ChevronUpIcon | ||
className="w-5 h-5 ml-2 -mr-1 text-cyan-100 hover:text-cyan-100" | ||
aria-hidden="true" | ||
/> | ||
</Menu.Button> | ||
<Transition | ||
as={Fragment} | ||
enter="transition ease-out duration-50" | ||
enterFrom="transform opacity-0 scale-95" | ||
enterTo="transform opacity-100 scale-100" | ||
leave="transition ease-in duration-50" | ||
leaveFrom="transform opacity-100 scale-100" | ||
leaveTo="transform opacity-0 scale-95" | ||
> | ||
<Menu.Items className="absolute left-0 bottom-10 w-32 mt-2 origin-top-right bg-white divide-y divide-gray-100 rounded-md shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none"> | ||
<div className="px-1 py-1"> | ||
<Menu.Item> | ||
<Link href="/" locale="en"> | ||
<a className="font-bold hover:bg-cyan-500 active:bg-cyan-500 hover:text-white text-gray-900 group flex rounded-md items-center w-full px-2 py-2 text-sm"> | ||
🇬🇧 EN | ||
</a> | ||
</Link> | ||
</Menu.Item> | ||
<Menu.Item> | ||
<Link href="/" locale="tr"> | ||
<a className="font-bold hover:bg-cyan-500 hover:text-white text-gray-900 group flex rounded-md items-center w-full px-2 py-2 text-sm"> | ||
🇹🇷 TR | ||
</a> | ||
</Link> | ||
</Menu.Item> | ||
</div> | ||
</Menu.Items> | ||
</Transition> | ||
</Menu> | ||
</div> | ||
); | ||
}; | ||
|
||
export default LanguageSelector; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export { default as HomePage } from './HomePage/HomePage'; | ||
export { default as ProfilePage } from './ProfilePage/ProfilePage'; | ||
export { default as DashboardPage } from './DashboardPage/DashboardPage'; | ||
export { default as OtherPage } from './OtherPage/OtherPage'; |
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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import { useContext } from 'react'; | ||
import { ErrorContext } from '../context/Error/errorContext'; | ||
|
||
// created custom hook | ||
export const useError = () => useContext(ErrorContext); |
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
5e3a7fa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
next-dapp-example – ./
nextjs-dapp-example.vercel.app
next-dapp-example-damla.vercel.app
next-dapp-example-git-main-damla.vercel.app