Skip to content

Commit

Permalink
Merge pull request #24 from SunbirdAI/github-actions
Browse files Browse the repository at this point in the history
GitHub actions
  • Loading branch information
evie-8 authored Sep 6, 2024
2 parents 8311155 + c27a498 commit efe9b02
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 65 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:

- name: Build
env:
REACT_APP_SB_API_URL: ${{ secrets.REACT_APP_API_URL }}
REACT_APP_SB_API_TOKEN: ${{ secrets.REACT_APP_API_TOKEN }}
REACT_APP_SB_API_URL: ${{ secrets.REACT_APP_SB_API_URL }}
REACT_APP_SB_API_TOKEN: ${{ secrets.REACT_APP_SB_API_TOKEN }}
REACT_APP_GA4_TRACKING_ID: ${{ secrets.REACT_APP_GA4_TRACKING_ID }}
REACT_APP_GA4_MEASUREMENT_ID: ${{ secrets.REACT_APP_GA4_MEASUREMENT_ID }}
REACT_APP_FEEDBACK_URL: $ {{ secrets.REACT_APP_FEEDBACK_URL }}

REACT_APP_FEEDBACK_URL: ${{ secrets.REACT_APP_FEEDBACK_URL }}
run: CI=false npm run build

- name: Deploy
uses: JamesIves/github-pages-deploy-action@v4
with:
Expand Down
125 changes: 64 additions & 61 deletions src/components/SamplePhrases/index.js
Original file line number Diff line number Diff line change
@@ -1,72 +1,75 @@
import {PhraseList, PhraseListItem, SamplePhrasesAccordion} from "./SamplePhrases.styles";
import {Accordion, AccordionSummary, AccordionDetails} from '@mui/material';
import {Tabs, Tab} from "@mui/material";
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import {useState} from "react";
import {samplePhraseDict} from "../../constants";
import {
PhraseList,
PhraseListItem,
SamplePhrasesAccordion,
} from "./SamplePhrases.styles";
import { Accordion, AccordionSummary, AccordionDetails } from "@mui/material";
import { Tabs, Tab } from "@mui/material";
import ExpandMoreIcon from "@mui/icons-material/ExpandMore";
import { useState } from "react";
import { samplePhraseDict } from "../../constants";

const WordList = ({ sentences, setSamplePhrase }) => {
const onClick = (index) => {
setSamplePhrase(sentences[index]);
};

const WordList = ({sentences, setSamplePhrase}) => {

const onClick = (index) => {
setSamplePhrase(sentences[index]);
};

return (
<PhraseList>
{sentences.map((sentence, index) => (
<PhraseListItem key={index} onClick={() => onClick(index)}>
{sentence}
</PhraseListItem>
))}
</PhraseList>
);
return (
<PhraseList>
{sentences.map((sentence, index) => (
<PhraseListItem key={index} onClick={() => onClick(index)}>
{sentence}
</PhraseListItem>
))}
</PhraseList>
);
};


const TabPanel = ({value, index, sentences, setSamplePhrase}) => (
<div>
{
value === index && (
<WordList sentences={sentences} setSamplePhrase={setSamplePhrase}/>
)
}
</div>
const TabPanel = ({ value, index, sentences, setSamplePhrase }) => (
<div>
{value === index && (
<WordList sentences={sentences} setSamplePhrase={setSamplePhrase} />
)}
</div>
);

const SamplePhrases = ({sourceLanguage, setSamplePhrase}) => {

const [tab, setTab] = useState(0);
const SamplePhrases = ({ sourceLanguage, setSamplePhrase }) => {
const [tab, setTab] = useState(0);

const handleChange = (event, newTab) => {
setTab(newTab);
}
const handleChange = (event, newTab) => {
setTab(newTab);
};

return (
<SamplePhrasesAccordion>
<Accordion>
<AccordionSummary
expandIcon={<ExpandMoreIcon/>}
>
<h2 className="font-bold text-xl">Sample Phrases</h2>
</AccordionSummary>
<AccordionDetails>
<Tabs value={tab} onChange={handleChange} variant="scrollable" scrollButtons="auto">
{samplePhraseDict[sourceLanguage].map((section, index) => <Tab key={index} label={section[0]}/>)}
</Tabs>
{samplePhraseDict[sourceLanguage].map((section, index) =>
<TabPanel
value={tab}
key={index}
index={index}
sentences={section[1]}
setSamplePhrase={setSamplePhrase}
/>
)}
</AccordionDetails>
</Accordion>
</SamplePhrasesAccordion>
)
return (
<SamplePhrasesAccordion>
<Accordion>
<AccordionSummary expandIcon={<ExpandMoreIcon />}>
<h2 className="font-bold text-xl">Sample Phrases</h2>
</AccordionSummary>
<AccordionDetails>
<Tabs
value={tab}
onChange={handleChange}
variant="scrollable"
scrollButtons="auto"
>
{samplePhraseDict[sourceLanguage].map((section, index) => (
<Tab key={index} label={section[0]} />
))}
</Tabs>
{samplePhraseDict[sourceLanguage].map((section, index) => (
<TabPanel
value={tab}
key={index}
index={index}
sentences={section[1]}
setSamplePhrase={setSamplePhrase}
/>
))}
</AccordionDetails>
</Accordion>
</SamplePhrasesAccordion>
);
};

export default SamplePhrases;

0 comments on commit efe9b02

Please sign in to comment.