Skip to content
Snippets Groups Projects
Commit 923212c4 authored by Joonas Seppä's avatar Joonas Seppä
Browse files

Modified the layout: Text to left side of the box and larger margins to the sides of the box

parent 283a2043
No related branches found
No related tags found
No related merge requests found
Pipeline #61746 passed
...@@ -48,12 +48,20 @@ const api = axios.create({ ...@@ -48,12 +48,20 @@ const api = axios.create({
baseURL: `https://messages-app-backend.herokuapp.com/` baseURL: `https://messages-app-backend.herokuapp.com/`
}); });
//justifyContent: "center"
const messageBox = { const messageBox = {
bgcolor: appColors.outsideBoxColor, bgcolor: appColors.outsideBoxColor,
marginX: 10, //marginX: 10,
marginX: 30,
//marginLeft: 20,
padding: 3, padding: 3,
display: "grid", //paddingY: 3,
justifyContent: "center", //paddingX: 10,
//display: "grid",
display: "flex",
flexDirection: "column",
justifyContent: "left",
boxShadow: 20, boxShadow: 20,
borderRadius: 5 borderRadius: 5
} }
......
...@@ -15,7 +15,9 @@ type IProps = { ...@@ -15,7 +15,9 @@ type IProps = {
export default class Message extends React.Component<IProps>{ export default class Message extends React.Component<IProps>{
formatTime = (date: Date) => { formatTime = (date: Date) => {
let today = new Date(); let today = new Date();
let weekdays = ['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];
if(date.getDay() === today.getDay()){ if(date.getDay() === today.getDay()){
return "today at " + date.toLocaleTimeString(); return "today at " + date.toLocaleTimeString();
...@@ -24,7 +26,7 @@ export default class Message extends React.Component<IProps>{ ...@@ -24,7 +26,7 @@ export default class Message extends React.Component<IProps>{
return "yesterday at " + date.toLocaleTimeString(); return "yesterday at " + date.toLocaleTimeString();
} }
else{ else{
return date.toLocaleString(); return "on " + weekdays[date.getDay()] + " " + date.toLocaleDateString() + " at " + date.toLocaleTimeString();
} }
} }
......
...@@ -9,15 +9,15 @@ export default class Welcome extends React.Component{ ...@@ -9,15 +9,15 @@ export default class Welcome extends React.Component{
sx={{ sx={{
bgcolor: appColors.outsideBoxColor, bgcolor: appColors.outsideBoxColor,
//color: "white", //color: "white",
marginX: 10, marginX: 30,
padding: 1, padding: 1,
marginY: 2, marginY: 3,
borderRadius: 5, borderRadius: 5,
boxShadow: 20 boxShadow: 20
}} }}
> >
<Typography variant="h3" sx={{textAlign: "center", margin: 3, color: appColors.singleMessageBoxColor}}> <Typography variant="h3" sx={{textAlign: "center", margin: 3, color: appColors.singleMessageBoxColor}}>
Welcome to my Messaging Application! Messaging Application
</Typography> </Typography>
</Box> </Box>
) )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment