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" ;
24import { connect } from "react-redux" ;
5+ import styled from "styled-components" ;
36import {
4- uploadPost ,
5- uploadImage ,
67 clearPostID ,
8+ uploadImage ,
9+ uploadPost ,
710} from "../../../actions/getPostAction" ;
8- import { convertToRaw , Editor , EditorState , RichUtils } from "draft-js" ;
911import { dispatchPopup } from "../../../actions/popupAction" ;
10- import * as S from "@chakra-ui/react" ;
11- import styled from "styled-components" ;
1212
1313const 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 = ({
126129const 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