-
Notifications
You must be signed in to change notification settings - Fork 835
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 #338 from AJIXuMuK/file-type-renderer-code-tour
CodeTour for FileTypeRenderer
- Loading branch information
Showing
1 changed file
with
35 additions
and
0 deletions.
There are no files selected for viewing
35 changes: 35 additions & 0 deletions
35
samples/react-field-pnp-file-type-renderer/.tours/file-type-renderer.tour
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,35 @@ | ||
{ | ||
"title": "file-type-renderer", | ||
"steps": [ | ||
{ | ||
"file": "src/extensions/fileTypeRenderer/components/FileTypeRenderer.tsx", | ||
"line": 12, | ||
"description": "We need two properties to render file type: `path` to the file or folder, and `isFolder` flag" | ||
}, | ||
{ | ||
"file": "src/extensions/fileTypeRenderer/components/FileTypeRenderer.tsx", | ||
"line": 41, | ||
"description": "In the `render` method we can simply use `FieldFileTypeRenderer` component. Required props are `path` and `isFolder` that were passed to the Field Customizer component. And we can also provide `cssProps` and `className` to customize the look and feel of the component" | ||
}, | ||
{ | ||
"file": "src/extensions/fileTypeRenderer/components/FileTypeRenderer.tsx", | ||
"line": 44, | ||
"description": "`styles.folderOverride` provides some styles needed to correctly align the folder icon." | ||
}, | ||
{ | ||
"file": "src/extensions/fileTypeRenderer/components/FileTypeRenderer.module.scss", | ||
"line": 5, | ||
"description": "Here are these styles." | ||
}, | ||
{ | ||
"file": "src/extensions/fileTypeRenderer/FileTypeRendererFieldCustomizer.ts", | ||
"line": 42, | ||
"description": "In the Field Customizer we're getting document's path from `FileLeafRef` field of the list item." | ||
}, | ||
{ | ||
"file": "src/extensions/fileTypeRenderer/FileTypeRendererFieldCustomizer.ts", | ||
"line": 43, | ||
"description": "`isFolder` is populated from `FSObjType` field." | ||
} | ||
] | ||
} |