Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import IMAGES from "@constants/images";
const INITIAL_STATE = {
data: [],
first_access_app: true,
car_info: {
km_atual: 10000,
marca: "Toyota",
modelo: "Etios",
versao: "1.5 XS Sedan",
ano: "2016/2016",
capacidade_tanque: 45,
ultima_revisao: "22/02/2019",
km_ultima_revisao: 7245
},
timeline: [
{ item: 'RADIATOR', name:"Água do radiador", percent: 0.5, last_update: null, next_update: null, image: IMAGES.CAR_ICONS.RADIATOR },
{ item: 'ALIGNMENT', name:"Alinhamento", percent: 0, last_update: null, next_update: null, image: IMAGES.CAR_ICONS.ALIGNMENT },
{ item: 'BALANCING', name:"Balanceamento e rodízio", percent: 0, last_update: null, next_update: null, image: IMAGES.CAR_ICONS.BALANCING },
{ item: 'BATTERY', name:"Bateria", percent: 0.5, last_update: null, next_update: null, image: IMAGES.CAR_ICONS.BATTERY },
{ item: 'BRAKEDISC', name:"Disco de freio", percent: 0, last_update: null, next_update: null, image: IMAGES.CAR_ICONS.BRAKEDISC },
{ item: 'BRAKEPADS', name:"Pastilha de freio", percent: 0, last_update: null, next_update: null, image: IMAGES.CAR_ICONS.BRAKEPADS },
{ item: 'CALIBRATION', name:"Calibramento", percent: 0, last_update: null, next_update: null, image: IMAGES.CAR_ICONS.CALIBRATION },
{ item: 'CANDLES', name:"Velas", percent: 0, last_update: null, next_update: null, image: IMAGES.CAR_ICONS.CANDLES },
{ item: 'FUEL', name:"Filtro de combustível", percent: 0, last_update: null, next_update: null, image: IMAGES.CAR_ICONS.FUEL },
{ item: 'FUSES', name:"Fusíveis", percent: 0.5, last_update: null, next_update: null , image: IMAGES.CAR_ICONS.FUSES},
{ item: 'OILCHANGE', name:"Troca de óleo", percent: 0, last_update: null, next_update: null, image: IMAGES.CAR_ICONS.OILCHANGE },
{ item: 'OILLEVEL', name:"Nível do óleo", percent: 0.5, last_update: null, next_update: null, image: IMAGES.CAR_ICONS.OILLEVEL },
{ item: 'POWERSTEERINGFLUID', name:"Fluído direção hidraúlica", percent: 0.5, last_update: null, next_update: null, image: IMAGES.CAR_ICONS.POWERSTEERINGFLUID },
{ item: 'SECURITY', name:"Itens de segurança", percent: 0.5, last_update: null, next_update: null, image: IMAGES.CAR_ICONS.SECURITY },
{ item: 'SIGNALING', name:"Sinalização", percent: 0.5, last_update: null, next_update: null, image: IMAGES.CAR_ICONS.SIGNALING },
{ item: 'TOOTHEDBELT', name:"Correia dentada", percent: 0, last_update: null, next_update: null, image: IMAGES.CAR_ICONS.TOOTHEDBELT },
{ item: 'WINDSHIELDWIPER', name:"Limpador de parabrisa", percent: 0.5, last_update: null, next_update: null, image: IMAGES.CAR_ICONS.WINDSHIELDWIPER },
],
history: [
{
data: "Hoje",
total_points: 0,
history: []
},
{
data: "20 de agosto",
total_points: 7,
increase: true,
history: [
{
title: "Calibragem",
description: "35 psi",
points: 12,
type: "success",
time: "19h27"
},
{
title: "Hora de trocar as velas",
description: "A cada dia que passa sem a troca das velas você deixa de economizar 12% no consumo de combustível",
points: 5,
type: "alert",
time: "19h27"
}
]
},
{
data: "17 de agosto",
total_points: 8,
increase: true,
history: [
{
title: "Abastecimento",
description: "Gasolina • R$ 20,00 • 13,43 litros",
points: 12,
type: "success",
time: "19h27"
},
]
},
],
loading: false,
error: false,
};
export default function app(state = INITIAL_STATE, action) {
switch (action.type) {
case 'UPDATE_CAR_INFO':
return { ...state, car_info: action.payload };
case 'UPDATE_TIMELINE':
return { ...state, timeline: action.payload };
case 'UPDATE_FIRST_ACCESS':
return { ...state, first_access_app: action.payload };
default:
return state;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.