Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 534 | Rev 536 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
5 stevensc 1
import React from 'react'
530 stevensc 2
import styled from 'styled-components'
3
import { device } from '../../styles/MediaQueries'
534 stevensc 4
import { Avatar } from '@mui/material'
5 stevensc 5
 
531 stevensc 6
const LayoutContainer = styled.div`
530 stevensc 7
  background-color: var(--bg-color);
8
  box-shadow: 0px 0px 0px 1px rgba(0, 0, 0, 0.08);
5 stevensc 9
  height: fit-content;
530 stevensc 10
  width: -moz-available;
11
  width: -webkit-fill-available;
12
  width: fill-available;
13
  @media ${device.tablet} {
14
    border-radius: var(--border-radius);
15
  }
5 stevensc 16
`
17
 
532 stevensc 18
const LayoutHeader = styled.div`
19
  display: flex;
20
  gap: 0.5rem;
21
  padding: 5px 1rem;
22
  align-items: center;
23
  position: relative;
24
`
25
 
535 stevensc 26
const LayoutBody = styled.div`
27
  padding: 1rem;
28
  display: flex;
29
  flex-direction: column;
30
  gap: 0.5rem;
31
  p {
32
    color: var(--font-color);
33
    font-size: 14px;
34
    text-align: justify;
35
  }
36
  span {
37
    font-size: 0.9rem;
38
  }
39
`
40
 
534 stevensc 41
const HeaderInfo = styled.div`
42
  align-items: center;
43
  display: inline-flex;
44
  gap: 0.5rem;
45
  width: fit-content;
535 stevensc 46
  h2 {
47
    font-size: 1rem;
48
  }
534 stevensc 49
`
50
 
531 stevensc 51
const LayoutActions = styled.div`
52
  display: flex;
532 stevensc 53
  justify-content: space-around;
531 stevensc 54
  border-top: 1px solid rgb(211, 211, 211);
532 stevensc 55
  padding: 5px 0;
531 stevensc 56
  & > button {
57
    align-items: center;
58
    border-radius: var(--border-radius);
59
    cursor: pointer;
60
    display: inline-flex;
61
    flex-direction: column;
62
    font-size: 0.9rem;
63
    padding: 5px;
64
    position: relative;
65
    &:hover {
66
      background-color: whitesmoke;
67
    }
68
    @media ${device.tablet} {
69
      flex-direction: row;
70
      gap: 0.5rem;
71
      font-size: 1rem;
72
    }
73
  }
74
`
75
 
76
const StyledContainer = ({ children, ...rest }) => {
77
  return <LayoutContainer {...rest}>{children}</LayoutContainer>
5 stevensc 78
}
79
 
531 stevensc 80
const Actions = ({ children, ...rest }) => {
81
  return <LayoutActions {...rest}>{children}</LayoutActions>
82
}
83
 
535 stevensc 84
const Body = ({ children, ...rest }) => {
85
  return <LayoutBody {...rest}>{children}</LayoutBody>
86
}
87
 
534 stevensc 88
const Header = ({ image, title, children, ...rest }) => {
89
  return (
90
    <LayoutHeader {...rest}>
91
      <HeaderInfo>
92
        {image && (
93
          <Avatar
94
            src={image}
95
            alt={`${title} profile image`}
96
            sx={{ width: '50px', height: '50px' }}
97
          />
98
        )}
99
        {title && <h2>{title}</h2>}
100
      </HeaderInfo>
101
      {children}
102
    </LayoutHeader>
103
  )
532 stevensc 104
}
105
 
531 stevensc 106
StyledContainer.Actions = Actions
532 stevensc 107
StyledContainer.Header = Header
535 stevensc 108
StyledContainer.Body = Body
531 stevensc 109
 
110
export default StyledContainer