Skip to content

Commit 6547e9a

Browse files
committed
add SelectableCell to iOS detail view
1 parent f52d584 commit 6547e9a

File tree

1 file changed

+13
-21
lines changed

1 file changed

+13
-21
lines changed

source/views/sis/student-work/detail.ios.js

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ const styles = StyleSheet.create({
2323
},
2424
})
2525

26+
const SelectableCell = ({text}: {text: string}) => (
27+
<Cell
28+
cellContentView={
29+
<Text selectable={true} style={styles.selectable}>
30+
{text}
31+
</Text>
32+
}
33+
/>
34+
)
35+
2636
function Title({job}: {job: JobType}) {
2737
return job.title || job.type
2838
? <Section header="JOB">
@@ -62,41 +72,23 @@ function Hours({job}: {job: JobType}) {
6272
function Description({job}: {job: JobType}) {
6373
return job.description
6474
? <Section header="DESCRIPTION">
65-
<Cell
66-
cellContentView={
67-
<Text selectable={true} style={styles.selectable}>
68-
{job.description}
69-
</Text>
70-
}
71-
/>
75+
<SelectableCell text={job.description} />
7276
</Section>
7377
: null
7478
}
7579

7680
function Skills({job}: {job: JobType}) {
7781
return job.skills
7882
? <Section header="SKILLS">
79-
<Cell
80-
cellContentView={
81-
<Text selectable={true} style={styles.selectable}>
82-
{job.skills}
83-
</Text>
84-
}
85-
/>
83+
<SelectableCell text={job.skills} />
8684
</Section>
8785
: null
8886
}
8987

9088
function Comments({job}: {job: JobType}) {
9189
return job.comments
9290
? <Section header="COMMENTS">
93-
<Cell
94-
cellContentView={
95-
<Text selectable={true} style={styles.selectable}>
96-
{job.comments}
97-
</Text>
98-
}
99-
/>
91+
<SelectableCell text={job.comments} />
10092
</Section>
10193
: null
10294
}

0 commit comments

Comments
 (0)