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

UI Fixes #8

Merged
merged 3 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions frontend/components/Datasets.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ const datasetIcons: { [key: string]: React.ReactElement } = {
interface FeatureProps {
title: string;
icon: string;
dataset_link: string;
}

interface Dataset {
Expand All @@ -55,9 +56,9 @@ interface Dataset {
// Aksharantar: { path: "", icon: "/assets/icons/xlit.png" },
// };

const Feature = ({ title, icon }: FeatureProps) => {
const Feature = ({ title, icon, dataset_link }: FeatureProps) => {
return (
<Stack>
<Stack as={Link} href={dataset_link}>
<Flex
w={16}
h={16}
Expand Down Expand Up @@ -192,6 +193,9 @@ export default function Datasets() {
<Feature
icon={dataset.area.toLowerCase()}
title={dataset.title}
dataset_link={
dataset.website_link ? dataset.website_link : ""
}
/>
</CardBody>
</Card>
Expand Down
21 changes: 6 additions & 15 deletions frontend/components/TryOut/NMT.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@ import {
import { LANGUAGE_CODE_NAMES } from "@/app/config";
import axios from "axios";
import { API_URL } from "@/app/config";
const IndicTransliterate =
typeof window !== "undefined"
? require("@ai4bharat/indic-transliterate").IndicTransliterate
: null;
import { IndicTransliterate } from "@ai4bharat/indic-transliterate";

const fetchTranslation = async ({
sourceLanguage,
Expand Down Expand Up @@ -124,29 +121,23 @@ export default function NMT({
</VStack>
</HStack>
<VStack w={"full"}>
{/* <IndicTransliterate
<IndicTransliterate
enabled={sourceLanguage !== "en" && transliteration}
renderComponent={(props) => (
<Textarea
minWidth={270}
width={{ base: "90%", md: "80%", lg: "100%" }}
{...props}
/>
)}
renderComponent={(props) => <Textarea {...props} />}
value={inputText}
onChangeText={(text) => {
setInputText(text);
}}
lang={sourceLanguage}
/> */}
<Textarea
/>
{/* <Textarea
minWidth={270}
width={{ base: "90%", md: "80%", lg: "100%" }}
value={inputText}
onChange={(event) => {
setInputText(event.target.value);
}}
/>
/> */}
<Textarea value={outputText} isReadOnly></Textarea>
<Button
onClick={async () => {
Expand Down
8 changes: 4 additions & 4 deletions frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@ai4bharat/indic-transliterate": "^1.3.7",
"@ai4bharat/indic-transliterate": "^1.3.2",
"@chakra-ui/icons": "^2.1.1",
"@chakra-ui/react": "^2.8.2",
"@emotion/react": "^11.13.3",
Expand Down
4 changes: 0 additions & 4 deletions frontend/src/app/areas/model/[area]/[title]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import { title } from "process";
import ModelView from "../../../../../../components/Models";

interface ParamsType {
slug: Array<string>;
}

interface Model {
area: string;
title: string;
Expand Down
25 changes: 0 additions & 25 deletions frontend/src/app/tools/[slug]/page.tsx

This file was deleted.

26 changes: 26 additions & 0 deletions frontend/src/app/tools/[tool]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import ToolComponent from "../../../../components/Dynamic/Tool";
import axios from "axios";

interface ToolType {
title: string;
}

export async function generateStaticParams() {
const response = await axios.get("https://admin.models.ai4bharat.org/tools/");

const tools = response.data;

let params: any[] = [];

tools.forEach((tool: ToolType) => {
params.push({
tool: tool.title,
});
});

return params;
}
export const dynamicParams = true;
export default function Tool({ params }: { params: { tool: string } }) {
return <ToolComponent slug={params.tool} />;
}
Loading