Skip to content

Commit 34ac3e4

Browse files
fixed compose post styles
1 parent c2802cf commit 34ac3e4

File tree

3 files changed

+36
-37
lines changed

3 files changed

+36
-37
lines changed

client/src/App.js

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
1+
import { Flex } from "@chakra-ui/react";
12
import React, { useEffect } from "react";
2-
// Router
3-
import { BrowserRouter as Router, Switch } from "react-router-dom";
4-
53
// Redux
64
import { Provider } from "react-redux";
7-
import store from "./store";
8-
5+
// Router
6+
import { BrowserRouter as Router, Switch } from "react-router-dom";
7+
import { loadUser } from "./actions/authAction";
8+
import Navbar from "./components/navbar/Navbar";
99
// Import Routes
1010
import Routes from "./Routes";
11-
11+
import store from "./store";
1212
// Import Utilities
1313
import setAuthToken from "./utils/setAuthToken";
14-
import { loadUser } from "./actions/authAction";
15-
import Navbar from "./components/navbar/Navbar";
16-
import PopupModal from "./components/popup-modal/PopupModal";
17-
18-
import { Flex } from "@chakra-ui/react";
1914

2015
if (localStorage.getItem("token")) {
2116
setAuthToken(localStorage.getItem("token"));
@@ -29,7 +24,6 @@ function App() {
2924
<Provider store={store}>
3025
<Router>
3126
<Navbar />
32-
<PopupModal />
3327
<Flex justifyContent="space-between" alignItems="flex-start">
3428
<Switch>
3529
<Routes />

client/src/components/alerts/Alert.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import {
22
Alert as A,
3+
AlertDescription,
34
AlertIcon,
45
AlertTitle,
5-
AlertDescription,
66
} from "@chakra-ui/react";
77
import React from "react";
88
import { connect } from "react-redux";

client/src/components/layout components/editor/PostEditor.js

Lines changed: 29 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import React, { useState, useEffect } from "react";
1+
import * as S from "@chakra-ui/react";
2+
import { convertToRaw, Editor, EditorState, RichUtils } from "draft-js";
3+
import React, { useEffect, useState } from "react";
24
import { connect } from "react-redux";
5+
import styled from "styled-components";
36
import {
4-
uploadPost,
5-
uploadImage,
67
clearPostID,
8+
uploadImage,
9+
uploadPost,
710
} from "../../../actions/getPostAction";
8-
import { convertToRaw, Editor, EditorState, RichUtils } from "draft-js";
911
import { dispatchPopup } from "../../../actions/popupAction";
10-
import * as S from "@chakra-ui/react";
11-
import styled from "styled-components";
1212

1313
const PostEditor = ({
1414
uploadPost,
@@ -78,17 +78,26 @@ const PostEditor = ({
7878
};
7979

8080
return (
81-
<S.Flex flexDir="column" px="300px" w="100%">
82-
<S.Flex>
83-
<S.Input
84-
type="file"
85-
name="file"
86-
id="file"
87-
className="custom-file-input"
88-
onChange={addFile}
89-
w="250px"
90-
/>
91-
{upload === "Uploading..." && <div>uploading...</div>}
81+
<S.Flex flexDir="column" px="300px" w="100%" py="4rem">
82+
<S.Flex alignItems="center">
83+
<S.Flex position="relative" mr="0.7rem">
84+
<S.Box h="40px" w="40px" bg="darkblue" rounded="md"></S.Box>
85+
<S.Input
86+
position="absolute"
87+
type="file"
88+
name="file"
89+
id="file"
90+
className="custom-file-input"
91+
onChange={addFile}
92+
w="40px"
93+
h="40px"
94+
opacity="0"
95+
/>
96+
</S.Flex>
97+
<S.Text fontSize="17px">Attatch an image</S.Text>
98+
</S.Flex>
99+
<S.Flex mt="1rem">
100+
{upload === "Uploading..." && <div>{upload}</div>}
92101
</S.Flex>
93102
<S.Flex mt="20px" w="100%">
94103
<S.Input
@@ -100,13 +109,7 @@ const PostEditor = ({
100109
onChange={handleHeadingChange}
101110
/>
102111
</S.Flex>
103-
<S.Box
104-
boxShadow="base"
105-
my="30px"
106-
mt="15px"
107-
rounded="md"
108-
border="2px solid #00000020"
109-
>
112+
<S.Box my="30px" mt="15px" rounded="md" border="2px dashed #a6a6a690">
110113
<EditorWrapper>
111114
<Editor
112115
editorState={editorState}
@@ -126,7 +129,9 @@ const PostEditor = ({
126129
const EditorWrapper = styled.div`
127130
.DraftEditor-root {
128131
.DraftEditor-editorContainer {
132+
padding-bottom: 30rem;
129133
.public-DraftEditor-content div {
134+
font-size: 20px;
130135
margin: 20px;
131136
div {
132137
margin: 0;

0 commit comments

Comments
 (0)