Revize cb25df10
Přidáno uživatelem Fantič před téměř 2 roky(ů)
src/components/item/ItemView.tsx | ||
---|---|---|
3 | 3 |
import { Item } from "../../types/item" |
4 | 4 |
import { Note } from "../../types/note" |
5 | 5 |
import LoadingBox from "../loading/LoadingBox" |
6 |
import NotesListView from "../notes/NotesListView" |
|
6 | 7 |
|
7 | 8 |
interface ItemDetailProps { |
8 | 9 |
item: Item, |
... | ... | |
37 | 38 |
); |
38 | 39 |
} |
39 | 40 |
|
40 |
const ItemNotes = (props: { notes: Note[] }) => { |
|
41 |
const notes = props.notes; |
|
42 |
return ( |
|
43 |
<Center> |
|
44 |
{ |
|
45 |
notes && notes.length > 0 ? ( |
|
46 |
<VStack> |
|
47 |
{notes.map((note, index) => ( |
|
48 |
<Box key={index}> |
|
49 |
<Text>{note.username}</Text> |
|
50 |
<Text>{note.note}</Text> |
|
51 |
</Box> |
|
52 |
))} |
|
53 |
</VStack> |
|
54 |
) : ( |
|
55 |
<Text>There are no notes for selected item.</Text> |
|
56 |
) |
|
57 |
} |
|
58 |
</Center> |
|
59 |
); |
|
60 |
} |
|
61 | 41 |
|
62 | 42 |
|
63 | 43 |
const ItemView = (props: ItemDetailProps) => { |
... | ... | |
86 | 66 |
notesLoading ? |
87 | 67 |
<LoadingBox text="Notes loading"/> |
88 | 68 |
: |
89 |
<ItemNotes notes={props.notes} />
|
|
69 |
<NotesListView notes={props.notes} />
|
|
90 | 70 |
)} |
91 | 71 |
|
92 | 72 |
{/* item notes switch tab */} |
Také k dispozici: Unified diff
re #10454: ItemView: NoteView class init