|
7 | 7 | SkeletonContainer,
|
8 | 8 | TextInput,
|
9 | 9 | Paragraph,
|
| 10 | + Card, |
10 | 11 | } from "@contentful/forma-36-react-components";
|
11 | 12 | import { FieldExtensionSDK } from "contentful-ui-extensions-sdk";
|
12 | 13 | import { v4 as uuid } from "uuid";
|
@@ -139,56 +140,50 @@ const RepeatableReferenceField = (props: FieldProps) => {
|
139 | 140 | draggableId={`${row.id}-${index}`}
|
140 | 141 | index={index}
|
141 | 142 | >
|
142 |
| - {(provided, snapshot) => { |
| 143 | + {(provided) => { |
143 | 144 | return (
|
144 | 145 | <div
|
145 | 146 | key={row.key}
|
146 | 147 | {...provided.draggableProps}
|
147 | 148 | {...provided.dragHandleProps}
|
148 | 149 | ref={provided.innerRef}
|
149 |
| - className="row" |
150 | 150 | style={{
|
151 | 151 | userSelect: "none",
|
152 |
| - backgroundColor: snapshot.isDragging |
153 |
| - ? "#f7f9fa" |
154 |
| - : "white", |
155 |
| - boxShadow: snapshot.isDragging |
156 |
| - ? "0px 0px 0px 1px rgb(25 37 50 / 10%), 0px -6px 16px -6px rgb(25 37 50 / 3%), 0px 8px 16px -8px rgb(25 37 50 / 20%), 0px 13px 27px -5px rgb(25 37 50 / 15%)" |
157 |
| - : "none", |
158 | 152 | ...provided.draggableProps.style,
|
159 | 153 | }}
|
160 | 154 | >
|
161 |
| - <div> |
162 |
| - <TextInput |
163 |
| - value={row[textKey]} |
164 |
| - placeholder={textLabel} |
165 |
| - data-index={index} |
166 |
| - onChange={onTextChanged} |
167 |
| - ></TextInput> |
168 |
| - </div> |
169 |
| - <div style={{ width: "200px" }}> |
170 |
| - {row.name ? ( |
171 |
| - <Paragraph>{row.name}</Paragraph> |
172 |
| - ) : ( |
173 |
| - <SkeletonContainer svgHeight="20"> |
174 |
| - <SkeletonBodyText numberOfLines="1"></SkeletonBodyText> |
175 |
| - </SkeletonContainer> |
176 |
| - )} |
177 |
| - </div> |
178 |
| - <div> |
179 |
| - <EditorToolbarButton |
180 |
| - icon="Delete" |
181 |
| - data-index={index} |
182 |
| - onClick={() => onDeleteButtonClicked(row)} |
183 |
| - ></EditorToolbarButton> |
184 |
| - </div> |
| 155 | + <Card className="row"> |
| 156 | + <div> |
| 157 | + <TextInput |
| 158 | + value={row[textKey]} |
| 159 | + placeholder={textLabel} |
| 160 | + data-index={index} |
| 161 | + onChange={onTextChanged} |
| 162 | + ></TextInput> |
| 163 | + </div> |
| 164 | + <div style={{ width: "200px" }}> |
| 165 | + {row.name ? ( |
| 166 | + <Paragraph>{row.name}</Paragraph> |
| 167 | + ) : ( |
| 168 | + <SkeletonContainer svgHeight="20"> |
| 169 | + <SkeletonBodyText numberOfLines="1"></SkeletonBodyText> |
| 170 | + </SkeletonContainer> |
| 171 | + )} |
| 172 | + </div> |
| 173 | + <div className="delete"> |
| 174 | + <EditorToolbarButton |
| 175 | + icon="Delete" |
| 176 | + data-index={index} |
| 177 | + onClick={() => onDeleteButtonClicked(row)} |
| 178 | + ></EditorToolbarButton> |
| 179 | + </div> |
| 180 | + </Card> |
185 | 181 | </div>
|
186 | 182 | );
|
187 | 183 | }}
|
188 | 184 | </Draggable>
|
189 | 185 | );
|
190 | 186 | })}
|
191 |
| - |
192 | 187 | {provided.placeholder}
|
193 | 188 | </div>
|
194 | 189 | );
|
|
0 commit comments