-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #559 from knowit/folk-504-org-struktur
folk-504 Oppdatert org struktur grafen
- Loading branch information
Showing
14 changed files
with
102 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
apps/web/src/pages/organizationStructure/Components/NameText.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import { useTheme } from '@mui/material' | ||
import { ReactNode } from 'react' | ||
import { EmployeeProfileInformation } from 'server/routers/employees/employeesTypes' | ||
|
||
interface Props { | ||
children: ReactNode | ||
employee: EmployeeProfileInformation | ||
searchTerm: string | ||
[k: string]: any | ||
} | ||
const NameText = ({ children, employee, searchTerm, ...rest }: Props) => { | ||
const theme = useTheme() | ||
const halo = theme.palette.background.paper // Stroke around the labels in case they overlap with a link | ||
const haloWidth = 0.2 | ||
|
||
return ( | ||
<text | ||
onClick={() => | ||
window.open( | ||
window.location.origin + '/ansatt/' + employee.email, | ||
'employee_' + employee.email | ||
) | ||
} | ||
style={{ cursor: 'hand' }} | ||
stroke={halo} | ||
strokeWidth={haloWidth} | ||
paintOrder="stroke" | ||
fill={theme.palette.text.primary} | ||
opacity={ | ||
searchTerm.length < 0 | ||
? 1 | ||
: employee.name.toLowerCase().includes(searchTerm) | ||
? 1 | ||
: 0.3 | ||
} | ||
{...rest} | ||
> | ||
{children} | ||
</text> | ||
) | ||
} | ||
|
||
export default NameText |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.