refactor note card to component
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
export default {
|
||||
component: true,
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
import { Component, ReactNode } from 'react';
|
||||
import NoteCard from '@/components/NoteCard/NoteCard';
|
||||
import { TicketNote } from '@/pages/TicketDetail/TicketNote';
|
||||
import { View } from '@tarojs/components';
|
||||
|
||||
interface NoteListProps {
|
||||
noteList: Array<TicketNote>;
|
||||
}
|
||||
|
||||
export default class NoteList extends Component<NoteListProps, {}> {
|
||||
props: Readonly<NoteListProps> = {
|
||||
noteList: [],
|
||||
};
|
||||
render(): ReactNode {
|
||||
return (
|
||||
<View>
|
||||
{this.props.noteList.map((note, idx) => (
|
||||
<View key={idx} style={{ marginTop: 8 }}>
|
||||
<NoteCard note={note} />
|
||||
</View>
|
||||
))}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user