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

bug: style mobile responsiveness of Home Page #329

Merged
merged 2 commits into from
Dec 2, 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
18 changes: 9 additions & 9 deletions frontend/src/components/Pages/Home/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ const Home = () => {
id="theme"
options={themes}
value={theme}
style={{ width: 300 }}
style={{ width: 300, margin: '0 auto' }}
onChange={(_event, newValue) => {
if (newValue != null)
setTheme(newValue)
Expand All @@ -54,7 +54,7 @@ const Home = () => {
if (newValue != null)
setLayout(newValue)
}}
style={{ width: 300 }}
style={{ width: 300, margin: '0 auto' }}
renderInput={(params) => <TextField {...params} label="Layout" variant="outlined" />}
/>
</Grid>
Expand All @@ -67,7 +67,7 @@ const Home = () => {
if (newValue != null)
setAnimation(newValue)
}}
style={{ width: 300 }}
style={{ width: 300, margin: '0 auto' }}
renderInput={(params) => <TextField {...params} label="Animation" variant="outlined" />}
/>

Expand All @@ -78,7 +78,7 @@ const Home = () => {
id="font"
options={fonts}
value={font}
style={{ width: 300 }}
style={{ width: 300, margin: '0 auto' }}
onChange={(_event, newValue) => {
if (newValue != null)
setFont(newValue)
Expand All @@ -92,7 +92,7 @@ const Home = () => {
id="font-color"
options={colorValues}
value={fontColor}
style={{ width: 300 }}
style={{ width: 300, margin: '0 auto' }}
onChange={(_event, newValue) => {
setFontColor(newValue)
}}
Expand All @@ -104,7 +104,7 @@ const Home = () => {
id="bg-color"
options={colorValues}
value={bgColor}
style={{ width: 300 }}
style={{ width: 300, margin: '0 auto' }}
onChange={(_event, newValue) => {
setBgColor(newValue)
}}
Expand All @@ -117,7 +117,7 @@ const Home = () => {
id="quote-type"
options={quoteTypes}
value={quoteType}
style={{ width: 300 }}
style={{ width: 300, margin: '0 auto' }}
onChange={(_event, newValue) => {
if (newValue != null)
setQuoteType(newValue)
Expand All @@ -129,7 +129,7 @@ const Home = () => {
</Grid>

<Grid container spacing={4}>
<Grid item xs={12} style={{ margin: '20px' }}>
<Grid item xs={12} style={{ marginTop: '20px' }}>
<TemplateCard theme={theme} animation={animation} layout={layout} font={font} fontColor={fontColor} bgColor={bgColor} quoteType={quoteType} />
</Grid>
<Grid item xs={12}>
Expand All @@ -150,4 +150,4 @@ const Home = () => {
)
}

export default Home;
export default Home;
12 changes: 5 additions & 7 deletions frontend/src/components/organisms/TemplateCard/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,16 @@ const TemplateCard = (props) => {
style={{ display: isImageLoaded ? "none" : "" }}
/>
</div>
<Grid container alignContent="center" style={{ margin: "20px" }}>
<Grid item sm={8} xs={12}>
<TextField fullWidth value={"![Quote](" + quoteUrl + ")"}></TextField>
<Grid container spacing={2} alignContent="center" justifyContent="center">
<Grid item style={{ flexGrow: 1 }}>
<TextField fullWidth value={"![Quote](" + quoteUrl + ")"} />
</Grid>
<Grid item sm={4} xs={12} style={{ textAlign: "center" }}>
<Grid item>
<Button
variant="contained"
color="primary"
disableElevation
onClick={() => {
copyToClipboard();
}}
onClick={copyToClipboard}
>
Copy Text
</Button>
Expand Down