Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 7314 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 7314 Rev 7316
Línea 1... Línea 1...
1
import React, { useState } from 'react'
1
import React, { useEffect, useState } from 'react'
2
import { axios } from '../../utils'
2
import { axios } from '../../utils'
3
import { useDispatch } from 'react-redux'
3
import { useDispatch } from 'react-redux'
4
import { addNotification } from '../../redux/notification/notification.actions'
4
import { addNotification } from '../../redux/notification/notification.actions'
5
import parse from 'html-react-parser'
5
import parse from 'html-react-parser'
6
import Avatar from '@mui/material/Avatar'
6
import Avatar from '@mui/material/Avatar'
Línea 23... Línea 23...
23
  span {
23
  span {
24
    font-weight: 600;
24
    font-weight: 600;
25
    color: var(--subtitle-color);
25
    color: var(--subtitle-color);
26
    display: flex;
26
    display: flex;
27
    align-items: center;
27
    align-items: center;
-
 
28
  }
-
 
29
  p {
28
    gap: 0.5rem;
30
    font-size: 1rem;
-
 
31
    color: var(--font-color);
29
  }
32
  }
30
  .info {
33
  .info {
31
    align-items: center;
34
    align-items: center;
32
    display: inline-flex;
35
    display: inline-flex;
33
    gap: 0.5rem;
36
    gap: 0.5rem;
34
  }
37
  }
35
  .name {
38
  .name {
36
    display: flex;
39
    display: flex;
37
    flex-direction: column;
40
    flex-direction: column;
38
    gap: 0.5rem;
-
 
39
  }
41
  }
40
  .details {
42
  .details {
41
    display: flex;
43
    display: flex;
42
    align-items: center;
44
    align-items: center;
43
    justify-content: space-between;
45
    justify-content: space-between;
44
    gap: 0.5rem;
46
    gap: 0.5rem;
45
  }
47
  }
-
 
48
  .job {
-
 
49
    display: flex;
-
 
50
    flex-direction: column;
-
 
51
    gap: 5px;
-
 
52
  }
46
`
53
`
Línea 47... Línea 54...
47
 
54
 
48
const StyledHeart = styled(Favorite)`
55
const StyledHeart = styled(Favorite)`
Línea 92... Línea 99...
92
  jobDescription = '',
99
  jobDescription = '',
93
  jobSkills = [],
100
  jobSkills = [],
94
  totalApplications = 0,
101
  totalApplications = 0,
95
  jobVisits = 0,
102
  jobVisits = 0,
96
}) => {
103
}) => {
97
  const [isJobSaved, setIsJobSaved] = useState(jobSaved !== 'job-save')
104
  const [isJobSaved, setIsJobSaved] = useState(false)
98
  const dispatch = useDispatch()
105
  const dispatch = useDispatch()
Línea 99... Línea 106...
99
 
106
 
100
  const handleClickFollow = () => {
107
  const handleClickFollow = () => {
101
    setIsJobSaved(!isJobSaved)
108
    setIsJobSaved(!isJobSaved)
Línea 118... Línea 125...
118
          )
125
          )
119
        }
126
        }
120
      })
127
      })
121
  }
128
  }
Línea -... Línea 129...
-
 
129
 
-
 
130
  useEffect(() => {
-
 
131
    setIsJobSaved(jobSaved !== 'job-save')
-
 
132
  }, [jobSaved])
122
 
133
 
123
  return (
134
  return (
124
    <StyledContainer>
135
    <StyledContainer>
125
      <div className="info">
136
      <div className="info">
126
        <Avatar
137
        <Avatar
Línea 132... Línea 143...
132
 
143
 
133
        <div className="name">
144
        <div className="name">
134
          <h3>{jobTitle}</h3>
145
          <h3>{jobTitle}</h3>
135
          <p>{companyName}</p>
146
          <p>{companyName}</p>
136
          <span>
147
          <span>
137
            <AccessTimeIcon />
148
            <AccessTimeIcon sx={{ fontSize: '1rem' }} />
138
            Posteado hace {timeElapsed}
149
            Posteado hace {timeElapsed}
139
          </span>
150
          </span>
140
        </div>
151
        </div>
Línea 141... Línea 152...
141
      </div>
152
      </div>
142
 
153
 
143
      <div className="details">
154
      <div className="details">
144
        <span>
155
        <span>
145
          <LocationOnIcon />
156
          <LocationOnIcon sx={{ color: '#cd5c5c' }} />
Línea 146... Línea 157...
146
          {location}
157
          {location}
147
        </span>
158
        </span>
148
 
159
 
149
        <span>
160
        <span>
-
 
161
          {isJobSaved ? (
-
 
162
            <StyledHeart sx={{ color: 'red' }} onClick={handleClickFollow} />
150
          {isJobSaved ? (
163
          ) : (
-
 
164
            <StyledHeartOutline
151
            <StyledHeart onClick={handleClickFollow} />
165
              sx={{ color: 'red' }}
152
          ) : (
166
              onClick={handleClickFollow}
153
            <StyledHeartOutline onClick={handleClickFollow} />
167
            />
154
          )}
168
          )}