Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 3369 | Rev 3585 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 3369 Rev 3462
Línea 1... Línea 1...
1
import React from 'react'
1
import React from 'react';
2
import {
2
import {
3
  Avatar,
3
  Avatar,
4
  Card,
4
  Card,
5
  CardActions,
5
  CardActions,
6
  CardContent,
6
  CardContent,
7
  CardHeader,
7
  CardHeader,
8
  CardMedia,
8
  CardMedia,
9
  styled
9
  styled
10
} from '@mui/material'
10
} from '@mui/material';
Línea 11... Línea 11...
11
 
11
 
Línea 12... Línea 12...
12
import colors from '@styles/colors'
12
import colors from '@styles/colors';
13
 
13
 
14
const WidgetContainer = styled(Card)(({ theme }) => ({
14
const WidgetContainer = styled(Card)(({ theme }) => ({
15
  borderRadius: 0,
15
  borderRadius: 0,
Línea 20... Línea 20...
20
  transition: theme.transitions.easing.easeInOut,
20
  transition: theme.transitions.easing.easeInOut,
21
  width: '100%',
21
  width: '100%',
22
  [theme.breakpoints.up('sm')]: {
22
  [theme.breakpoints.up('sm')]: {
23
    borderRadius: theme.shape.borderRadius
23
    borderRadius: theme.shape.borderRadius
24
  }
24
  }
25
}))
25
}));
Línea 26... Línea 26...
26
 
26
 
27
export function Widget({ children, styles, ...props }) {
27
export function Widget({ children, styles, ...props }) {
28
  return (
28
  return (
29
    <WidgetContainer sx={styles} {...props}>
29
    <WidgetContainer sx={styles} {...props}>
30
      {children}
30
      {children}
31
    </WidgetContainer>
31
    </WidgetContainer>
32
  )
32
  );
Línea 33... Línea 33...
33
}
33
}
34
 
34
 
35
export function WidgetHeader({
35
export function WidgetHeader({
Línea 59... Línea 59...
59
        padding: 1,
59
        padding: 1,
60
        ...styles
60
        ...styles
61
      }}
61
      }}
62
      {...props}
62
      {...props}
63
    />
63
    />
64
  )
64
  );
65
}
65
}
Línea 66... Línea 66...
66
 
66
 
67
export function WidgetBody({ children, styles = {}, ...props }) {
67
export function WidgetBody({ children, styles = {}, ...props }) {
68
  return (
68
  return (
Línea 75... Línea 75...
75
      }}
75
      }}
76
      {...props}
76
      {...props}
77
    >
77
    >
78
      {children}
78
      {children}
79
    </CardContent>
79
    </CardContent>
80
  )
80
  );
81
}
81
}
Línea 82... Línea 82...
82
 
82
 
83
export function WidgetActions({ children, styles = {}, ...props }) {
83
export function WidgetActions({ children, styles = {}, ...props }) {
84
  return (
84
  return (
Línea 97... Línea 97...
97
      disableSpacing
97
      disableSpacing
98
      {...props}
98
      {...props}
99
    >
99
    >
100
      {children}
100
      {children}
101
    </CardActions>
101
    </CardActions>
102
  )
102
  );
103
}
103
}
Línea 104... Línea 104...
104
 
104
 
105
export function WidgetMedia({
-
 
106
  src = '',
-
 
107
  height,
-
 
108
  width,
-
 
109
  alt = '',
-
 
110
  type = 'image',
-
 
111
  styles = {},
-
 
112
  ...props
-
 
113
}) {
105
export function WidgetMedia({ src = '', height, width, alt = '', type = 'image', styles = {} }) {
114
  const getMediaComponent = (type) => {
106
  const getMediaComponent = (type) => {
115
    const options = {
107
    const options = {
116
      image: 'img',
108
      image: 'img',
117
      video: 'video',
109
      video: 'video',
118
      audio: 'audio'
110
      audio: 'audio'
Línea 119... Línea 111...
119
    }
111
    };
120
 
112
 
Línea 121... Línea 113...
121
    return options[type] ?? options.image
113
    return options[type] ?? options.image;
122
  }
114
  };
123
 
115
 
124
  return (
116
  return (
Línea 131... Línea 123...
131
      sx={{
123
      sx={{
132
        objectFit: 'contain',
124
        objectFit: 'contain',
133
        ...styles
125
        ...styles
134
      }}
126
      }}
135
    />
127
    />
136
  )
128
  );
137
}
129
}
Línea 138... Línea 130...
138
 
130
 
139
Widget.Header = WidgetHeader
131
Widget.Header = WidgetHeader;
140
Widget.Body = WidgetBody
132
Widget.Body = WidgetBody;
141
Widget.Actions = WidgetActions
133
Widget.Actions = WidgetActions;
Línea 142... Línea 134...
142
Widget.Media = WidgetMedia
134
Widget.Media = WidgetMedia;