-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* create query to get story translation progress * return percentage in get/update translation * update progress bar styling
- Loading branch information
Showing
9 changed files
with
133 additions
and
15 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
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.translation { | ||
display: flex; | ||
flex-direction: row; | ||
} | ||
|
||
.translation-container { | ||
flex-basis: 75%; | ||
} | ||
|
||
.translation-sidebar { | ||
flex-basis: 25%; | ||
} | ||
|
||
.translation-progress-bar { | ||
margin: 20px 30px 0 0; | ||
} |
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,37 @@ | ||
import React, { useState } from "react"; | ||
import "./TranslationPage.css"; | ||
import { useParams } from "react-router-dom"; | ||
import TranslationProgressBar from "../translation/TranslationProgressBar"; | ||
|
||
type TranslationPageProps = { | ||
storyId: string | undefined; | ||
storyTranslationId: string | undefined; | ||
}; | ||
|
||
const TranslationPage = () => { | ||
const { storyId, storyTranslationId } = useParams<TranslationPageProps>(); | ||
// TODO: set percentageComplete based on return from get translation query, | ||
// and update when edits made to page | ||
// const [percentageComplete, setPercentageComplete] = useState(0); | ||
const [percentageComplete] = useState(25); | ||
if (storyId === undefined || storyTranslationId === undefined) { | ||
return ( | ||
<div className="error"> | ||
<p>Error loading page</p> | ||
</div> | ||
); | ||
} | ||
|
||
return ( | ||
<div className="translation"> | ||
<div className="translation-container" /> | ||
<div className="translation-sidebar"> | ||
<div className="translation-progress-bar"> | ||
<TranslationProgressBar percentageComplete={percentageComplete} /> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default TranslationPage; |
22 changes: 22 additions & 0 deletions
22
frontend/src/components/translation/TranslationProgressBar.css
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,22 @@ | ||
.progress-bar-container { | ||
max-width: 123px; | ||
padding: 5px; | ||
} | ||
|
||
.progress { | ||
background-color: #ECF1F4; | ||
border-radius: 8px; | ||
box-shadow: inset 0px 2px 2px -1px rgba(74, 74, 104, 0.1); | ||
height: 6px; | ||
} | ||
|
||
.progress-bar { | ||
background-color: var(--dark-blue); | ||
} | ||
|
||
.progress-label { | ||
color: var(--interactive-grey); | ||
font-size: 10px; | ||
line-height: 14px; | ||
margin-bottom: 8px; | ||
} |
24 changes: 24 additions & 0 deletions
24
frontend/src/components/translation/TranslationProgressBar.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,24 @@ | ||
import React from "react"; | ||
import { ProgressBar } from "react-bootstrap"; | ||
import "./TranslationProgressBar.css"; | ||
|
||
type TranslationProgressBarProps = { | ||
percentageComplete: number; | ||
}; | ||
|
||
const TranslationProgressBar = ({ | ||
percentageComplete, | ||
}: TranslationProgressBarProps) => { | ||
return ( | ||
<div className="progress-bar-container"> | ||
<p className="progress-label"> | ||
Translation Progress: {percentageComplete}% | ||
</p> | ||
<div> | ||
<ProgressBar now={percentageComplete} /> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default TranslationProgressBar; |
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