Precisamos refatorar o APP para conseguir que as atividades retornadas sejam renderizadas, e atualmente o app tem os componentes necessários, só que não tá adaptado para a forma em que a API retorna os dados. Essa parte é pra ser fácil, não vai da muito trabalho.
[
{
"id": "4934e034-ab92-4a66-aaf3-88ba7b4399ae",
"title": "Activity 0",
"description": "Activity test",
"phase_id": "2895a53e-b43f-43fb-8ae8-ef7bf4da1f00",
"type": "block_activity",
"is_needed_code": false,
"order": 0,
"created_at": "2022-04-18T21:32:33.877Z",
"options": [
{
"id": "dfb1a720-0e23-4a8d-a59c-24dd8e7b56fe",
"name": "Option 0",
"activity_id": "4934e034-ab92-4a66-aaf3-88ba7b4399ae",
"type": "js_function",
"hexadecimal_color": "#335A6A",
"created_at": "2022-04-18T21:32:33.918Z"
},
{
"id": "dd2650d7-baf3-414c-8a7f-5f81534ea855",
"name": "Option 2",
"activity_id": "4934e034-ab92-4a66-aaf3-88ba7b4399ae",
"type": "js_function",
"hexadecimal_color": "#335A6A",
"created_at": "2022-04-18T21:32:33.941Z"
},
{
"id": "759a5418-9ce4-432a-8035-30a1bcfc7f90",
"name": "Option 1",
"activity_id": "4934e034-ab92-4a66-aaf3-88ba7b4399ae",
"type": "js_function",
"hexadecimal_color": "#335A6A",
"created_at": "2022-04-18T21:32:33.933Z"
}
],
"tips": [],
"activity_answer": [],
"default_code": []
},
{
"id": "f3103f97-dca4-4dce-a509-f13d39950f09",
"title": "Activity 1",
"description": "Activity test",
"phase_id": "2895a53e-b43f-43fb-8ae8-ef7bf4da1f00",
"type": "block_activity",
"is_needed_code": false,
"order": 1,
"created_at": "2022-04-18T21:32:33.949Z",
"options": [
{
"id": "49961168-03ca-443c-83e0-105f49492c12",
"name": "Option 1",
"activity_id": "f3103f97-dca4-4dce-a509-f13d39950f09",
"type": "js_function",
"hexadecimal_color": "#335A6A",
"created_at": "2022-04-18T21:32:33.966Z"
},
{
"id": "b7d3bec7-e7c0-49cf-bedc-908afd2f68d8",
"name": "Option 0",
"activity_id": "f3103f97-dca4-4dce-a509-f13d39950f09",
"type": "js_function",
"hexadecimal_color": "#335A6A",
"created_at": "2022-04-18T21:32:33.957Z"
},
{
"id": "697d4a8b-ca56-40e4-bf96-3950fb111c55",
"name": "Option 2",
"activity_id": "f3103f97-dca4-4dce-a509-f13d39950f09",
"type": "js_function",
"hexadecimal_color": "#335A6A",
"created_at": "2022-04-18T21:32:33.982Z"
}
],
"tips": [],
"activity_answer": [],
"default_code": []
},
{
"id": "4c117d44-5592-47eb-b943-98b5c3d0d62f",
"title": "Activity 2",
"description": "Activity test",
"phase_id": "2895a53e-b43f-43fb-8ae8-ef7bf4da1f00",
"type": "block_activity",
"is_needed_code": false,
"order": 2,
"created_at": "2022-04-18T21:32:33.995Z",
"options": [
{
"id": "bfa7e5ac-9851-4263-8098-ddc617374f35",
"name": "Option 2",
"activity_id": "4c117d44-5592-47eb-b943-98b5c3d0d62f",
"type": "js_function",
"hexadecimal_color": "#335A6A",
"created_at": "2022-04-18T21:32:34.032Z"
},
{
"id": "eee6c03b-6ff5-4059-b0cb-205921fe8be5",
"name": "Option 1",
"activity_id": "4c117d44-5592-47eb-b943-98b5c3d0d62f",
"type": "js_function",
"hexadecimal_color": "#335A6A",
"created_at": "2022-04-18T21:32:34.024Z"
},
{
"id": "4bdc3151-a472-4318-8f3e-81d3d680b5eb",
"name": "Option 0",
"activity_id": "4c117d44-5592-47eb-b943-98b5c3d0d62f",
"type": "js_function",
"hexadecimal_color": "#335A6A",
"created_at": "2022-04-18T21:32:34.013Z"
}
],
"tips": [],
"activity_answer": [],
"default_code": []
},
{
"id": "d07b4a05-f06e-4db0-a265-8325beabed73",
"title": "Activity 3",
"description": "Activity test",
"phase_id": "2895a53e-b43f-43fb-8ae8-ef7bf4da1f00",
"type": "block_activity",
"is_needed_code": false,
"order": 3,
"created_at": "2022-04-18T21:32:34.042Z",
"options": [
{
"id": "39e3c728-a563-4ff4-93b1-dec50330e150",
"name": "Option 2",
"activity_id": "d07b4a05-f06e-4db0-a265-8325beabed73",
"type": "js_function",
"hexadecimal_color": "#335A6A",
"created_at": "2022-04-18T21:32:34.081Z"
},
{
"id": "c828b514-5671-4aca-85c3-d865f03baa62",
"name": "Option 0",
"activity_id": "d07b4a05-f06e-4db0-a265-8325beabed73",
"type": "js_function",
"hexadecimal_color": "#335A6A",
"created_at": "2022-04-18T21:32:34.057Z"
},
{
"id": "061353ea-2689-4d6f-acaf-05c800942b16",
"name": "Option 1",
"activity_id": "d07b4a05-f06e-4db0-a265-8325beabed73",
"type": "js_function",
"hexadecimal_color": "#335A6A",
"created_at": "2022-04-18T21:32:34.073Z"
}
],
"tips": [],
"activity_answer": [],
"default_code": []
},
{
"id": "3b2c655d-105a-4cd9-88c8-7d6c5533bfbf",
"title": "Activity 4",
"description": "Activity test",
"phase_id": "2895a53e-b43f-43fb-8ae8-ef7bf4da1f00",
"type": "block_activity",
"is_needed_code": false,
"order": 4,
"created_at": "2022-04-18T21:32:34.107Z",
"options": [
{
"id": "382d18fa-38cd-4dd2-9920-c516a9ca66b2",
"name": "Option 2",
"activity_id": "3b2c655d-105a-4cd9-88c8-7d6c5533bfbf",
"type": "js_function",
"hexadecimal_color": "#335A6A",
"created_at": "2022-04-18T21:32:34.131Z"
},
{
"id": "74ebd8dd-7be6-4ea3-a113-7816920c4f15",
"name": "Option 1",
"activity_id": "3b2c655d-105a-4cd9-88c8-7d6c5533bfbf",
"type": "js_function",
"hexadecimal_color": "#335A6A",
"created_at": "2022-04-18T21:32:34.123Z"
},
{
"id": "3ebd4ae9-304c-4cd9-ae06-a3e62bbe9855",
"name": "Option 0",
"activity_id": "3b2c655d-105a-4cd9-88c8-7d6c5533bfbf",
"type": "js_function",
"hexadecimal_color": "#335A6A",
"created_at": "2022-04-18T21:32:34.114Z"
}
],
"tips": [],
"activity_answer": [],
"default_code": []
}
]
A gente pega esse array e para cada atividade renderiza um componente que já fizemos. Bem simples!
Podemos enviar esse tipo de fase para o componente que já criamos.