Skip to content

Commit

Permalink
added language to filtered car
Browse files Browse the repository at this point in the history
  • Loading branch information
ashura-code committed Jan 7, 2024
1 parent 3460ca1 commit 0c03c26
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/issues/[org]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default function page({ params }: { params: { org: string } }) {
title={item.title}
body={item.body}
organization={params.org}
language={data.language}
language={localStorage.getItem(`orglang-${params.org}`)}
date={item.created_at}
/>
</Link>
Expand Down
10 changes: 9 additions & 1 deletion app/issues/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ export default function Issues() {
}

function Filter() {

const setLanguage = (name,language)=>{
localStorage.setItem(`orglang-${name}`,language);
}




return (
<Dialog>
<DialogTrigger asChild>
Expand All @@ -50,7 +58,7 @@ function Filter() {
</Button>
{organizations.map((org) => (
<Button size="sm" className="px-3" key={org.org}>
<Link href={`issues/${org.org}`}>{org.org}</Link>
<Link href={`issues/${org.org}`}onClick={()=>setLanguage(org.org,org.language)} >{org.org}</Link>
</Button>
))}
</div>
Expand Down

0 comments on commit 0c03c26

Please sign in to comment.