-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create IconField component in shared, use in EditPropertiesPanel
- Loading branch information
Showing
6 changed files
with
72 additions
and
77 deletions.
There are no files selected for viewing
8 changes: 0 additions & 8 deletions
8
...rts/src/components/ProjectInformation/EditPropertiesPanel/EditPropertiesPanel.module.scss
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
7 changes: 7 additions & 0 deletions
7
SharePointFramework/shared-library/src/components/IconField/IconField.module.scss
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,7 @@ | ||
.iconLabel { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
gap: 8px; | ||
padding-bottom: 5px; | ||
} |
27 changes: 27 additions & 0 deletions
27
SharePointFramework/shared-library/src/components/IconField/index.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,27 @@ | ||
import React, { FC } from 'react' | ||
import { Field, Text } from '@fluentui/react-components' | ||
import styles from './IconField.module.scss' | ||
import { IIconFieldProps } from './types' | ||
|
||
export const IconField: FC<IIconFieldProps> = (props) => { | ||
return ( | ||
<Field | ||
label={{ | ||
children: () => { | ||
const Icon = props.icon | ||
return ( | ||
<div className={styles.iconLabel}> | ||
{Icon && <Icon />} | ||
<Text size={200} weight='semibold'> | ||
{props.label} | ||
</Text> | ||
</div> | ||
) | ||
} | ||
}} | ||
hint={props.hint} | ||
> | ||
{props.children} | ||
</Field> | ||
) | ||
} |
12 changes: 12 additions & 0 deletions
12
SharePointFramework/shared-library/src/components/IconField/types.ts
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,12 @@ | ||
import { FieldProps } from '@fluentui/react-components' | ||
import { FluentIcon } from '@fluentui/react-icons/lib/utils/createFluentIcon' | ||
|
||
/** | ||
* Props for the IconField component. | ||
*/ | ||
export interface IIconFieldProps extends FieldProps { | ||
/** | ||
* The icon for the label component. | ||
*/ | ||
icon?: FluentIcon | ||
} |
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