l-min-components 1.0.311 → 1.0.315

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "l-min-components",
3
- "version": "1.0.311",
3
+ "version": "1.0.315",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "src/assets",
@@ -1,4 +1,10 @@
1
- import React, { useState, useEffect, createContext, useRef, useContext } from "react";
1
+ import React, {
2
+ useState,
3
+ useEffect,
4
+ createContext,
5
+ useRef,
6
+ useContext,
7
+ } from "react";
2
8
  import { Outlet, useLocation } from "react-router-dom";
3
9
  import {
4
10
  Layout,
@@ -23,6 +29,10 @@ const AppMainLayout = () => {
23
29
  const [rightComponent, setRightComponent] = useState();
24
30
  const [generalData, setGeneralData] = useState({});
25
31
  const [coming, setComing] = useState();
32
+ const [hasLayoutBackgroundImage, setHasLayoutBackgroundImage] =
33
+ useState(false);
34
+ const [sideMenuLayout, setSideMenuLayout] = useState(true);
35
+
26
36
  useEffect(() => {
27
37
  if (window.location.host.includes("coming")) {
28
38
  setComing(true);
@@ -33,21 +43,37 @@ const AppMainLayout = () => {
33
43
 
34
44
  return (
35
45
  <OutletContext.Provider
36
- value={{ setRightComponent, setRightLayout, generalData, setGeneralData, coming }}
46
+ value={{
47
+ setRightComponent,
48
+ setRightLayout,
49
+ generalData,
50
+ setGeneralData,
51
+ coming,
52
+ hasLayoutBackgroundImage,
53
+ setHasLayoutBackgroundImage,
54
+ setSideMenuLayout,
55
+ }}
37
56
  >
38
- <Layout coming={coming}>
57
+ <Layout
58
+ coming={coming}
59
+ hasLayoutBackgroundImage={hasLayoutBackgroundImage}
60
+ >
39
61
  <HeaderComponent />
40
62
  <MainLayout coming={coming}>
41
63
  <LeftLayout>
42
64
  <SideBar routes={leftNavMenu} />
43
65
  {!coming && (
44
- <SideMenu
45
- user={user}
46
- routes={sideMenuOptions}
47
- userType={"developer"}
48
- isOpen={isOpen}
49
- setIsOpen={setIsOpen}
50
- />
66
+ <>
67
+ {sideMenuLayout && (
68
+ <SideMenu
69
+ user={user}
70
+ routes={sideMenuOptions}
71
+ userType={"developer"}
72
+ isOpen={isOpen}
73
+ setIsOpen={setIsOpen}
74
+ />
75
+ )}
76
+ </>
51
77
  )}
52
78
  </LeftLayout>
53
79
  <CenterLayout isOpen={isOpen}>
@@ -1,16 +1,27 @@
1
1
  import styled from "styled-components";
2
- import Pattern from "../../assets/images/pattern.png";
2
+ import Pattern from "../../assets/images/sign_up.png";
3
+ import LayoutBackgroundImage from "../../assets/images/layout_background.png";
3
4
 
4
5
  /* styles for main layout component */
5
6
  export const Layout = styled.div`
6
- background-color: ${({coming}) => coming ? "#FEBF10" : "#e5e5e5"};
7
- background-image: ${({coming}) => coming ? `url(${Pattern})` : "none"};
7
+ background-color: ${({ coming }) => (coming ? "#FEBF10" : "#e5e5e5")};
8
+ background-image: ${({ coming, hasLayoutBackgroundImage }) =>
9
+ coming
10
+ ? `url(${Pattern})`
11
+ : hasLayoutBackgroundImage
12
+ ? `url(${LayoutBackgroundImage})`
13
+ : ""};
8
14
  min-height: 100vh;
9
15
  width: 100%;
16
+ background-repeat: no-repeat;
17
+ background-size: ${({ hasLayoutBackgroundImage }) =>
18
+ hasLayoutBackgroundImage ? "100%" : ""};
19
+ background-position: ${({ hasLayoutBackgroundImage }) =>
20
+ hasLayoutBackgroundImage ? "bottom" : ""};
10
21
  `;
11
22
 
12
23
  export const MainLayout = styled.div`
13
- background-color: ${({coming}) => coming ? "none" : "#e5e5e5"};
24
+ background-color: ${({ coming }) => (coming ? "none" : "#e5e5e5")};
14
25
  display: flex;
15
26
  justify-content: space-between;
16
27
  width: 100%;
@@ -3,12 +3,12 @@ import React, { createContext } from "react";
3
3
  import MessagesContext, { useMessagesContext } from "../hooks/messagesContext";
4
4
  import Messages from "./messages";
5
5
 
6
- const MessagesAddon = () => {
6
+ const MessagesAddon = ({ close }) => {
7
7
  const messagesContextData = useMessagesContext();
8
8
 
9
9
  return (
10
10
  <MessagesContext.Provider value={messagesContextData}>
11
- <Messages />
11
+ <Messages close={close} />
12
12
  </MessagesContext.Provider>
13
13
  );
14
14
  };
@@ -10,8 +10,8 @@ export const MessagesWrapper = styled.div`
10
10
  background-color: rgba(0, 194, 194, 1);
11
11
 
12
12
  .message_by_wrapper {
13
- border-top-left-radius: 30px;
14
- border-top-right-radius: 30px;
13
+ border-radius: ${({ isFullHeight }) =>
14
+ isFullHeight ? "30px 30px 0 0" : "30px"};
15
15
  display: flex;
16
16
  align-items: center;
17
17
  background-color: rgba(0, 194, 194, 1);
@@ -51,6 +51,8 @@ export const MessagesContainer = styled.div`
51
51
  overflow-y: auto;
52
52
  background-color: #ffffff;
53
53
  border-radius: 30px;
54
+ height: ${({ isFullHeight }) => (isFullHeight ? "" : "0px")};
55
+
54
56
  h1 {
55
57
  margin-top: 0px;
56
58
  margin-bottom: 20px;
@@ -854,7 +856,7 @@ export const TextMessagePanel = styled.div`
854
856
  border-radius: 15px;
855
857
  /* overflow-x: hidden; */
856
858
  &.text-mode {
857
- padding: 16px 0;
859
+ padding: 3px 0;
858
860
  }
859
861
  svg {
860
862
  cursor: pointer;
@@ -863,7 +865,7 @@ export const TextMessagePanel = styled.div`
863
865
  .icon-box {
864
866
  display: flex;
865
867
  align-items: center;
866
- padding: 0 27px;
868
+ padding: 0 5px 0 10px;
867
869
  gap: 25px;
868
870
  span {
869
871
  display: flex;
@@ -32,7 +32,7 @@ import { BsFunnel } from "react-icons/bs";
32
32
  import { BsChevronDown } from "react-icons/bs";
33
33
  import { MdOutlineClose } from "react-icons/md";
34
34
 
35
- const Messages = (props) => {
35
+ const Messages = ({ close }) => {
36
36
  const [showEmoji, setShowEmoji] = useState(false);
37
37
  const [chatOptions, setChatOptions] = useState(false);
38
38
  const [modalIsOpen, setIsOpen] = useState(false);
@@ -62,6 +62,7 @@ const Messages = (props) => {
62
62
  const [roomID, setRoomID] = useState("");
63
63
  const [userID, setUserID] = useState("");
64
64
  const [userChatList, setUserChatList] = useState([]);
65
+ const [isFullHeight, setIsFullHeight] = useState(true);
65
66
 
66
67
  const {
67
68
  handleRoomMessage,
@@ -248,15 +249,15 @@ const Messages = (props) => {
248
249
  <p className="mbw_name"> Message By Julius </p>
249
250
 
250
251
  <div className="icon-box">
251
- <span>
252
+ <span onClick={() => setIsFullHeight(!isFullHeight)}>
252
253
  <BsChevronDown />
253
254
  </span>
254
- <span>
255
+ <span onClick={close}>
255
256
  <MdOutlineClose />
256
257
  </span>
257
258
  </div>
258
259
  </div>
259
- <MessagesContainer>
260
+ <MessagesContainer isFullHeight={isFullHeight}>
260
261
  <CardContainer>
261
262
  <>
262
263
  <ChatHeader