continued learning react-native

This commit is contained in:
Christian Landgren 2020-12-15 02:38:36 +01:00
parent 2a064ca709
commit 4fba77ceda
13 changed files with 327 additions and 88 deletions

View File

@ -1,20 +0,0 @@
0 silly argv { _: [ 'create' ],
0 silly argv lernaVersion: '3.22.1',
0 silly argv '$0': 'lerna',
0 silly argv name: 'app' }
1 notice cli v3.22.1
2 verbose rootPath /Users/cln/src/skolplattformen
3 warn ENOREMOTE No git remote found, skipping repository property
4 error Error: canceled
4 error at Interface.<anonymous> (/Users/cln/.nvm/versions/node/v10.11.0/lib/node_modules/lerna/node_modules/read/lib/read.js:66:13)
4 error at Interface.emit (events.js:182:13)
4 error at Interface._ttyWrite (readline.js:783:16)
4 error at ReadStream.onkeypress (readline.js:168:10)
4 error at ReadStream.emit (events.js:182:13)
4 error at emitKeys (internal/readline.js:424:14)
4 error at emitKeys.next (<anonymous>)
4 error at ReadStream.onData (readline.js:1022:36)
4 error at ReadStream.emit (events.js:182:13)
4 error at addChunk (_stream_readable.js:283:12)
4 error at readableAddChunk (_stream_readable.js:264:11)
4 error at ReadStream.Readable.push (_stream_readable.js:219:10)

View File

@ -92,6 +92,12 @@ api.register({
const schedule = await backend.getSchedule(childId, cookie)
return res.status(200).json(schedule)
},
getClassmates: async (c, req, res) => {
const cookie = c.security.bearerAuth
const childId = c.request.params.order
const classmates = await backend.getClassmates(childId, cookie)
return res.status(200).json(classmates)
},
download: async (c, req, res) => {
const cookie = c.security.bearerAuth
const url = c.request.query.url

View File

@ -52,6 +52,10 @@ const getSchedule = (childId, cookie) => fetchJson(urls.schedule(childId, moment
.then(schedule => schedule.map(({title, id, description, location, longEventDateTime: startDate, longEndDateTime: endDate, allDayEvent: allDay, mentor}) => ({title, id, description, location, startDate, endDate, allDay, mentor})))
.catch(err => ({err}))
const getClassmates = (childId, cookie) => fetchJson(urls.classmates(childId), cookie)
.then(classmates => classmates.map(({sisId, firstname, lastname, location, guardians, className}) => ({sisId, firstname, lastname, location, guardians, className})))
.catch(err => ({err}))
const getChildById = async (childId, cookie) => {
const children = await getChildren()
const child = children.find(c => c.id == childId)
@ -76,5 +80,6 @@ module.exports = {
getNotifications,
getMenu,
getSchedule,
getClassmates,
download
}

View File

@ -5,6 +5,7 @@ const urls = {
//loginTarget: `https://login001.stockholm.se/NECSadc/mbid/b64startpage.jsp?startpage=aHR0cHM6Ly9ldGphbnN0LnN0b2NraG9sbS5zZS92YXJkbmFkc2hhdmFyZS9pbmxvZ2dhZDIvaGVt`,
loginTarget: 'https://login003.stockholm.se/NECSadcmbid/authenticate/SiteMinderAuthADC?TYPE=33554433&REALMOID=06-42f40edd-0c5b-4dbc-b714-1be1e907f2de&GUID=&SMAUTHREASON=0&METHOD=GET&SMAGENTNAME=IfNE0iMOtzq2TcxFADHylR6rkmFtwzoxRKh5nRMO9NBqIxHrc38jFyt56FASdxk1&TARGET=-SM-HTTPS%3a%2f%2flogin001%2estockholm%2ese%2fNECSadc%2fmbid%2fb64startpage%2ejsp%3fstartpage%3daHR0cHM6Ly9ldGphbnN0LnN0b2NraG9sbS5zZS92YXJkbmFkc2hhdmFyZS9pbmxvZ2dhZDIvR2V0Q2hpbGRyZW4%3d',
children: `${baseUrl}/vardnadshavare/inloggad2/GetChildren`,
classmates: childId => `${baseurl}/vardnadshavare/inloggad2/contacts/GetStudentsByClass?studentId=${childId}`,
calendar: childId => `${baseUrl}/vardnadshavare/inloggad2/Calender/GetSchoolCalender?childId=${childId}&rowLimit=50`,
user: `${baseUrl}/vardnadshavare/base/getuserdata`,
news: childId => `${baseUrl}/vardnadshavare/inloggad2/News/GetNewsOverview?childId=${childId}`,

View File

@ -189,6 +189,29 @@ paths:
application/json:
schema:
$ref: "#/components/schemas/Calendar"
/children/{childSdsId}/classmates:
get:
summary: Classmates
operationId: getClassmates
description: Get list of class mates and guardians in this childs class
security:
- bearerAuth: []
tags:
- Children
parameters:
- name: childId
in: path
description: Child Id (received from /children)
required: true
schema:
type: string
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: "#/components/schemas/Classmates"
/children/{childSdsId}/notifications:
get:
summary: Notifications
@ -369,6 +392,29 @@ components:
notifications:
$ref: "#/components/schemas/Notifications"
Classmates:
type: array
items:
$ref: "#/components/schemas/Classmate"
Classmate:
type: object
properties:
sisId:
type: string
format: uuid
className:
type: string
description: The name of the class of this classmate
example: "8C"
firstname:
type: string
example: "Max"
lastname:
type: string
example: "Svensson"
guardians:
type: object
Notifications:
type: array
items:

View File

@ -5,16 +5,17 @@ import {
IconRegistry
} from '@ui-kitten/components';
import { EvaIconsPack } from '@ui-kitten/eva-icons';
import * as material from '@eva-design/material';
import * as eva from '@eva-design/eva';
import customization from './design/customization.json';
import children from './output.json';
import {ChildList} from './components/childList.component'
import {AppNavigator} from './components/tabs.component'
export default () => (
<>
<IconRegistry icons={EvaIconsPack}/>
<ApplicationProvider {...material} theme={{...material.dark, customization}}>
<ApplicationProvider {...eva} theme={{...eva.light, customization}}>
<ChildList children={children} />
</ApplicationProvider>
</>

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 16.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
width="185px" height="63px" viewBox="0 0 185 63" enable-background="new 0 0 185 63" xml:space="preserve">
<g>
<g>
<path fill="#1D1D1B" d="M52.791,0H0.037C0.02,0.556-0.321,14.721,1.487,23.643c2.958,14.599,11.115,27.729,24.925,39.422
c13.813-11.693,21.966-24.824,24.932-39.422C53.154,14.721,52.804,0.556,52.791,0"/>
<path fill="#FFFFFF" d="M33.177,9.163c0.631,0,1.146,0.513,1.146,1.144c0,0.629-0.514,1.147-1.146,1.147
c-0.63,0-1.144-0.518-1.144-1.147C32.033,9.676,32.546,9.163,33.177,9.163"/>
<path fill="#FFFFFF" d="M19.652,9.163c0.63,0,1.142,0.513,1.142,1.144c0,0.629-0.512,1.147-1.142,1.147
c-0.631,0-1.147-0.518-1.147-1.147C18.505,9.676,19.021,9.163,19.652,9.163"/>
<path fill="#FFFFFF" d="M16.498,39.622c0.978,0,1.025-0.507,1.069-0.669c-0.188,0.188-0.567,0.317-1.154,0.317
c-0.593,0-1.166-0.242-1.474-1.201c-0.155-0.496-0.032-1.065-0.032-1.065s0.648,0.517,1.148,0.489
c0.889-0.046,1.56-0.612,1.56-1.632c0-1.203-0.856-2.497-2.539-4.494c-1.5-1.776-2.24-3.69-2.24-5.568
c0-4.427,4.411-7.22,4.411-7.22s0.461,11.07,0.552,12.266c0.096,1.195,0.375,3.236,1.087,4.821v3.856
c-0.195,0.609-0.963,0.863-1.499,0.863C16.968,40.383,16.445,39.989,16.498,39.622"/>
<path fill="#FFFFFF" d="M26.413,17.063c-6.53,0-9.876,0.775-9.876,0.775l-0.856-1.723c0,0,4.53-0.87,10.732-0.87
c6.202,0,10.739,0.87,10.739,0.87l-0.858,1.723C36.293,17.838,32.947,17.063,26.413,17.063"/>
<path fill="#FFFFFF" d="M32.275,48.641H20.556l-1.932-2.165c0,0,1.222-1.114,1.222-3.152v-6.07
c-0.021-0.005,2.254,3.292,6.567,3.292c3.789,0,6.61-3.221,6.571-3.21v5.989c0,2.038,1.222,3.152,1.222,3.152L32.275,48.641z"/>
<path fill="#FFFFFF" d="M36.775,37.492c0.498,0.028,1.148-0.489,1.148-0.489s0.122,0.569-0.035,1.065
c-0.3,0.959-0.881,1.2-1.467,1.2c-0.592,0-0.972-0.127-1.159-0.315c0.044,0.162,0.094,0.669,1.069,0.669
c0.053,0.368-0.468,0.762-0.888,0.762c-0.538,0-1.305-0.254-1.498-0.863v-3.856c0.709-1.585,0.986-3.626,1.081-4.821
c0.093-1.195,0.559-12.266,0.559-12.266s4.406,2.793,4.406,7.22c0,1.878-0.736,3.792-2.238,5.568
c-1.686,1.997-2.539,3.291-2.539,4.494C35.214,36.88,35.881,37.445,36.775,37.492"/>
<path fill="#FFFFFF" d="M37.539,15.344c0,0-4.713-0.949-11.126-0.949c-6.41,0-11.12,0.949-11.12,0.949L12.18,9.11
c0,0,0.919-0.637,1.576-0.637c1.156,0,1.416,1.039,1.416,1.403c0,0.288-0.035,0.508-0.207,0.705l-0.049,0.05
c-0.26,0.295-0.325,0.371-0.325,0.568c0,0.179,0.125,0.46,0.464,0.46c0.299,0,0.371-0.095,0.505-0.472
c0.141-0.382,0.516-0.766,1.049-0.766c0.522,0,1.104,0.454,1.104,1.103c0,0.693-0.565,1.107-1.104,1.107
c-0.311,0-0.456-0.088-0.557-0.151c-0.069-0.041-0.104-0.062-0.162-0.062c-0.067,0-0.12,0.046-0.148,0.081
c-0.086,0.102-0.12,0.271-0.086,0.436c0.088,0.475,0.989,1.211,2,1.211c1.503,0,2.416-1.354,2.416-2.332
c0.578,1.375,1.855,1.666,2.74,1.666c2.382,0,2.875-2.113,2.875-2.679c0-0.38-0.122-0.691-0.234-0.746
c-0.016-0.004-0.058-0.024-0.134,0.048l-0.097,0.082c-0.288,0.264-0.83,0.751-1.589,0.751c-0.851,0-1.733-0.639-1.733-1.707
c0-1.135,0.87-1.728,1.728-1.728c0.714,0,1.117,0.391,1.391,0.652c0.104,0.104,0.213,0.213,0.271,0.213
c0.119,0,0.232-0.05,0.306-0.132c0.056-0.065,0.091-0.15,0.091-0.239c0-0.015,0-0.035-0.004-0.052
c-0.01-0.077-0.104-0.17-0.213-0.28c-0.234-0.245-0.558-0.579-0.558-1.226c0-0.743,0.603-1.535,1.502-1.539
c0.905,0.003,1.505,0.795,1.505,1.539c0,0.647-0.325,0.981-0.562,1.226c-0.106,0.11-0.196,0.203-0.206,0.28
c0,0.017-0.003,0.037-0.003,0.052c0,0.089,0.032,0.173,0.089,0.239c0.07,0.083,0.184,0.132,0.305,0.132
c0.061,0,0.169-0.108,0.273-0.213c0.269-0.261,0.675-0.652,1.389-0.652c0.857,0,1.727,0.592,1.727,1.728
c0,1.067-0.887,1.707-1.735,1.707c-0.755,0-1.3-0.487-1.588-0.751l-0.09-0.082c-0.082-0.072-0.123-0.052-0.137-0.048
c-0.11,0.054-0.234,0.366-0.234,0.746c0,0.565,0.49,2.679,2.87,2.679c0.883,0,2.162-0.291,2.74-1.666
c0,0.978,0.913,2.332,2.42,2.332c1.011,0,1.908-0.736,1.995-1.211c0.037-0.165,0-0.333-0.085-0.436
c-0.03-0.035-0.081-0.081-0.149-0.081c-0.059,0-0.096,0.021-0.161,0.062c-0.102,0.063-0.245,0.151-0.557,0.151
c-0.539,0-1.103-0.414-1.103-1.107c0-0.648,0.583-1.103,1.103-1.103c0.531,0,0.909,0.384,1.05,0.766
c0.139,0.376,0.208,0.472,0.507,0.472c0.339,0,0.463-0.281,0.463-0.46c0-0.198-0.062-0.273-0.327-0.568l-0.044-0.05
c-0.173-0.197-0.212-0.417-0.212-0.705c0-0.364,0.265-1.403,1.42-1.403c0.658,0,1.574,0.637,1.574,0.637L37.539,15.344z"/>
<path fill="#FFFFFF" d="M34.523,18.494c-0.04,0.874-0.331,8.023-0.365,10.033c-0.01,0.824-0.233,3.622-0.443,4.671
c-0.465,2.318-2.528,6.241-7.303,6.241c-4.769,0-6.833-3.923-7.297-6.241c-0.212-1.053-0.439-3.85-0.449-4.671
c-0.027-2.01-0.322-9.159-0.357-10.033c0.521-0.079,3.444-0.488,8.104-0.488C31.079,18.006,34,18.415,34.523,18.494"/>
<path fill="#1D1D1B" d="M31.359,21.949c-0.415,0-0.858,0.066-1.219,0.345c-0.191,0.146-0.253,0.347,0.032,0.347
c0.498,0,0.812,0.454,0.812,0.794c0,0.34-0.217,0.512-0.467,0.512c-0.251,0-0.391,0.226-0.128,0.28
c0.276,0.053,0.552,0.084,0.965,0.084c1.431,0,2.196-0.465,2.196-0.862C33.551,23.051,32.767,21.949,31.359,21.949"/>
<path fill="#1D1D1B" d="M21.978,20.422c0.657,0.17,1.63,0.527,2.349,1.249c0.739,0.743,1.024,1.481,1.126,1.994
c0.089,0.432,0.243,0.45,0.374,0.029c0.189-0.606,0.246-1.545-0.617-2.514c-0.794-0.892-2.011-1.088-2.727-1.088
c-0.174,0-0.346,0.014-0.5,0.036C21.569,20.18,21.548,20.312,21.978,20.422"/>
<path fill="#1D1D1B" d="M29.332,33.816c-0.417-0.2-1.565-0.758-1.84-0.883c-0.153-0.073-0.214-0.083-0.375-0.083h-1.419
c-0.163,0-0.226,0.01-0.375,0.083c-0.28,0.125-1.43,0.684-1.838,0.883c-0.231,0.11-0.198,0.332,0.023,0.332h5.799
C29.527,34.148,29.558,33.926,29.332,33.816"/>
<path fill="#1D1D1B" d="M24.168,23.449c0-0.398-0.779-1.502-2.188-1.502c-0.414,0-0.857,0.068-1.217,0.348
c-0.19,0.146-0.252,0.347,0.032,0.347c0.495,0,0.812,0.454,0.812,0.794c0,0.34-0.218,0.512-0.47,0.512
c-0.246,0-0.389,0.228-0.126,0.28c0.279,0.053,0.552,0.085,0.968,0.085C23.407,24.312,24.168,23.846,24.168,23.449"/>
<path fill="#1D1D1B" d="M28.28,34.977h-3.734c-0.196,0-0.226,0.188-0.091,0.278c0.117,0.083,0.884,0.593,1.057,0.702
c0.135,0.083,0.2,0.095,0.365,0.095h1.071c0.167,0,0.234-0.013,0.369-0.095c0.17-0.109,0.936-0.619,1.055-0.702
C28.502,35.164,28.477,34.977,28.28,34.977"/>
<path fill="#1D1D1B" d="M32.222,20.096c-0.551,0-0.905-0.003-1.822-0.003c-1.886,0-3.193,1.564-3.193,3.462v5.552
c0,0.316-0.122,0.511-0.454,0.511h-0.337c-0.182,0-0.373,0.044-0.546,0.191c-0.284,0.238-0.975,0.833-1.068,0.953
c-0.1,0.112-0.072,0.25,0.215,0.25h3.73c0.212,0,0.304-0.093,0.13-0.25c-0.234-0.217-0.988-0.941-0.988-0.941v-5.599
c0-1.459,0.282-3.255,3.032-3.255c0.731,0,1.379,0.002,1.497,0.002c1.003,0,1.537-0.876,1.537-0.876S32.769,20.096,32.222,20.096"
/>
</g>
<g>
<path fill="#1D1D1B" d="M62.277,21.176c0.812,0.977,2.188,1.797,3.627,1.866c1.634,0.079,2.689-0.838,2.689-1.813
c0-1.18-0.886-1.871-2.548-2.562l-1.328-0.536c-2.537-1.046-3.793-2.562-3.793-4.613c0-2.538,2.441-4.187,5.004-4.187
c1.945,0,3.428,0.645,4.661,2.026l-1.844,1.645c-0.84-0.905-1.646-1.266-2.812-1.266c-1.138,0-2.324,0.637-2.324,1.731
c0,1.024,0.823,1.79,2.507,2.46l1.307,0.557c2.299,0.934,3.867,2.316,3.867,4.522c0,2.209-1.772,4.501-5.362,4.501
c-2.479,0-4.289-1.123-5.708-2.566L62.277,21.176z"/>
<path fill="#1D1D1B" d="M79.538,25.309H77.5c-2.387,0-3.801-1.416-3.801-3.776v-6.21h-2.025v-2.434h2.025V9.963h2.73v2.925h3.108
v2.434H76.43v5.64c0,1.266,0.348,1.838,1.765,1.838h1.344V25.309z"/>
<path fill="#1D1D1B" d="M80.835,19.099c0-3.626,2.732-6.409,6.435-6.409c3.675,0,6.432,2.782,6.432,6.409
c0,3.627-2.757,6.408-6.432,6.408C83.567,25.507,80.835,22.726,80.835,19.099 M90.895,19.099c0-2.161-1.515-3.8-3.625-3.8
c-2.138,0-3.626,1.64-3.626,3.8c0,2.161,1.489,3.801,3.626,3.801C89.38,22.9,90.895,21.26,90.895,19.099"/>
<g>
<path fill="#1D1D1B" d="M95.46,19.099c0-3.626,2.731-6.409,6.409-6.409c1.985,0,3.6,0.821,4.744,2.063l-1.864,1.912
c-0.645-0.746-1.589-1.318-2.88-1.318c-2.113,0-3.603,1.591-3.603,3.751c0,2.161,1.49,3.751,3.603,3.751
c1.291,0,2.235-0.57,2.88-1.317l1.864,1.913c-1.144,1.241-2.759,2.062-4.744,2.062C98.191,25.507,95.46,22.726,95.46,19.099"/>
</g>
<polygon fill="#1D1D1B" points="111.33,25.309 108.598,25.309 108.598,7.969 111.33,7.969 111.33,18.503 116.297,12.889
119.527,12.889 114.362,18.776 120.147,25.309 116.796,25.309 111.33,19.099 "/>
<path fill="#1D1D1B" d="M124.18,17.485v7.825h-2.732V7.969h2.732v6.088c0.869-0.945,2.185-1.367,3.479-1.367
c3.079,0,5.042,2.137,5.042,5.341v7.278h-2.735V18.08c0-1.341-0.991-2.782-2.83-2.782
C125.721,15.298,124.652,16.043,124.18,17.485"/>
<g>
<path fill="#1D1D1B" d="M134.916,19.099c0-3.626,2.73-6.409,6.432-6.409c3.676,0,6.433,2.782,6.433,6.409
c0,3.627-2.757,6.408-6.433,6.408C137.646,25.507,134.916,22.726,134.916,19.099 M144.974,19.099c0-2.161-1.515-3.8-3.626-3.8
c-2.137,0-3.626,1.64-3.626,3.8c0,2.161,1.49,3.801,3.626,3.801C143.459,22.9,144.974,21.26,144.974,19.099"/>
</g>
<rect x="149.996" y="7.969" fill="#1D1D1B" width="2.732" height="17.34"/>
<path fill="#1D1D1B" d="M158.134,17.409v7.9h-2.734v-12.42h2.734v1.168c0.844-0.97,2.061-1.366,3.206-1.366
c1.737,0,3.053,0.694,3.872,1.912c1.168-1.541,2.908-1.912,4.099-1.912c3.057,0,4.794,2.135,4.794,5.34v7.277h-2.732V18.08
c0-1.341-0.771-2.782-2.558-2.782c-1.243,0-2.236,0.745-2.708,2.162c0.026,0.198,0.026,0.373,0.026,0.571v7.277h-2.733V18.08
c0-1.341-0.794-2.782-2.582-2.782C159.6,15.298,158.58,16.043,158.134,17.409"/>
<path fill="#1D1D1B" d="M175.632,23.354l0.221,0.201c1.478,1.343,2.901,1.996,4.649,1.996c2.954,0,4.498-1.856,4.498-3.689
c0-1.631-1.051-2.835-3.213-3.684l-1.035-0.427c-1.619-0.621-1.805-1.225-1.805-1.629c0-0.657,0.792-1.102,1.558-1.102
c0.844,0,1.41,0.297,2.017,0.928l0.18,0.189l1.827-1.576l-0.184-0.197c-1.003-1.086-2.21-1.653-3.844-1.653
c-2.074,0-4.22,1.292-4.22,3.453c0,1.655,1.064,2.917,3.163,3.754l1.043,0.404c1.341,0.54,1.837,1.002,1.837,1.709
c0,0.549-0.631,1.12-1.69,1.12c-0.047,0-0.093-0.001-0.141-0.003c-0.961-0.044-2.079-0.514-2.734-1.273l-0.178-0.207
L175.632,23.354z"/>
<path fill="#1D1D1B" d="M61.109,43.729l0.219,0.2c1.479,1.346,2.902,1.997,4.65,1.997c2.952,0,4.497-1.855,4.497-3.687
c0-1.632-1.05-2.836-3.212-3.686l-1.038-0.427c-1.618-0.619-1.804-1.225-1.804-1.627c0-0.66,0.793-1.103,1.561-1.103
c0.844,0,1.407,0.296,2.015,0.928l0.18,0.188l1.828-1.575l-0.185-0.197c-1.002-1.086-2.21-1.654-3.843-1.654
c-2.074,0-4.219,1.292-4.219,3.452c0,1.656,1.064,2.919,3.162,3.757l1.042,0.404c1.341,0.539,1.84,1.001,1.84,1.707
c0,0.55-0.633,1.121-1.693,1.121c-0.045,0-0.093-0.001-0.141-0.004c-0.961-0.045-2.077-0.512-2.733-1.273l-0.177-0.208
L61.109,43.729z"/>
<path fill="#1D1D1B" d="M79.538,45.726H77.5c-2.387,0-3.801-1.416-3.801-3.774v-6.21h-2.025v-2.434h2.025v-2.926h2.73v2.926h3.108
v2.434H76.43v5.638c0,1.268,0.348,1.839,1.765,1.839h1.344V45.726z"/>
<path fill="#1D1D1B" d="M90.547,44.809c-0.868,0.694-2.01,1.116-3.327,1.116c-3.676,0-6.385-2.781-6.385-6.408
c0-3.625,2.709-6.407,6.385-6.407c1.317,0,2.458,0.422,3.327,1.117v-0.917h2.733v12.417h-2.733V44.809z M90.547,41.628v-4.222
c-0.646-1.018-1.912-1.689-3.302-1.689c-2.112,0-3.601,1.639-3.601,3.8c0,2.16,1.489,3.801,3.601,3.801
C88.635,43.317,89.901,42.647,90.547,41.628"/>
<path fill="#1D1D1B" d="M105.171,44.809c-0.868,0.694-2.01,1.116-3.327,1.116c-3.677,0-6.384-2.781-6.384-6.408
c0-3.625,2.707-6.407,6.384-6.407c1.316,0,2.458,0.422,3.327,1.117v-5.839h2.733v17.338h-2.733V44.809z M105.171,41.628v-4.222
c-0.646-1.018-1.912-1.689-3.302-1.689c-2.113,0-3.603,1.639-3.603,3.8c0,2.16,1.49,3.801,3.603,3.801
C103.259,43.317,104.524,42.647,105.171,41.628"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -1,24 +1,35 @@
import React from 'react';
import { StyleSheet, View } from 'react-native';
import { Card, List, Text } from '@ui-kitten/components';
import CalendarStrip from 'react-native-calendar-strip';
import { StyleSheet } from 'react-native';
import { Divider, List, ListItem, Icon, Text} from '@ui-kitten/components';
export const Calendar = ({calendar}) => {
const renderItemIcon = (props) => (
<Icon {...props} name='calendar-outline'/>
);
const renderItem = ({ item }) => (
<ListItem
title={`${item.title}`}
description={`${item.startDate}`}
accessoryLeft={renderItemIcon}
/>
);
return (
<View style={styles.container}>
<CalendarStrip
scrollable
style={{height:150, paddingTop: 20, paddingBottom: 10}}
calendarColor={'#3343CE'}
calendarHeaderStyle={{color: 'white'}}
dateNumberStyle={{color: 'white'}}
dateNameStyle={{color: 'white'}}
iconContainer={{flex: 0.1}}
/>
</View>
<List
style={styles.container}
data={calendar}
ItemSeparatorComponent={Divider}
renderItem={renderItem}
/>
);
};
const styles = StyleSheet.create({
container: { flex: 1, height: 100 }
container: {
maxHeight: 200,
width: "100%"
},
});

View File

@ -3,17 +3,26 @@ import { StyleSheet } from 'react-native';
import { Layout, Text, ViewPager, Button, Icon } from '@ui-kitten/components';
import { NewsList } from './newsList.component'
import { Calendar } from './calendar.component'
import { ChildTopNavigation } from './childTopNavigation.component';
import { BottomNavigation, BottomNavigationTab } from '@ui-kitten/components';
const SelectCategory = ({child}) => {
const [selectedIndex, setSelectedIndex] = React.useState(0);
return (
<BottomNavigation
selectedIndex={selectedIndex}
onSelect={index => setSelectedIndex(index)}>
<BottomNavigationTab title='Nyheter'/>
<BottomNavigationTab title='Kalender'/>
<BottomNavigationTab title='Klassen'/>
</BottomNavigation>
);
};
export const ChildList = ({children}) => {
const [selectedIndex, setSelectedIndex] = React.useState(0);
const renderShakeIcon = (props) => (
<Icon
{...props}
animation='shake'
name='shake'
/>
)
return (
<ViewPager
@ -24,14 +33,11 @@ export const ChildList = ({children}) => {
key={child.id}
style={{...styles.tab}}
level='2'>
<Text category='h5'>{ child.name}</Text>
<Button
appearance='ghost'
style={styles.button}
accessoryRight={renderShakeIcon}>
Sjukanmälan
</Button>
<ChildTopNavigation child={child}></ChildTopNavigation>
<SelectCategory>
</SelectCategory>
<NewsList news={child.news} />
<Calendar calendar={[...child.calendar, ...child.schedule] }></Calendar>
</Layout>
)}
</ViewPager>
@ -45,9 +51,4 @@ const styles = StyleSheet.create({
alignItems: 'center',
justifyContent: 'center',
},
button: {
flex: 1,
marginVertical: 10,
backgroundColor: "#FEF2DC"
}
});

View File

@ -0,0 +1,63 @@
import React from 'react'
import { StyleSheet, View } from 'react-native'
import { Avatar, Icon, MenuItem, OverflowMenu, Text, TopNavigation, TopNavigationAction } from '@ui-kitten/components'
const MenuIcon = (props) => (
<Icon {...props} name='more-vertical' />
)
const InfoIcon = (props) => (
<Icon {...props} name='info' />
)
const LogoutIcon = (props) => (
<Icon {...props} name='log-out' />
)
export const ChildTopNavigation = ({child}) => {
const [menuVisible, setMenuVisible] = React.useState(false)
const toggleMenu = () => {
setMenuVisible(!menuVisible)
}
const renderMenuAction = () => (
<TopNavigationAction icon={MenuIcon} onPress={toggleMenu} />
)
const renderOverflowMenuAction = () => (
<React.Fragment>
<OverflowMenu anchor={renderMenuAction} visible={menuVisible} onBackdropPress={toggleMenu}>
<MenuItem accessoryLeft={InfoIcon} title='Sjukanmälan' />
<MenuItem accessoryLeft={InfoIcon} title='Kontakta' />
<MenuItem accessoryLeft={LogoutIcon} title='Logga ut' />
</OverflowMenu>
</React.Fragment>
)
const renderTitle = (props) => (
<View style={styles.titleContainer}>
<Icon {...props} style={styles.logo} name='person'/>
<Text {...props}>
{child.name}
</Text>
</View>
)
return (
<TopNavigation title={renderTitle} accessoryRight={renderOverflowMenuAction} />
)
}
const styles = StyleSheet.create({
titleContainer: {
flexDirection: 'row',
alignItems: 'center'
},
logo: {
marginHorizontal: 16,
width: 16,
height: 16
}
})

View File

@ -1,10 +1,11 @@
import React from 'react';
import { StyleSheet, View } from 'react-native';
import { Card, List, Text } from '@ui-kitten/components';
import Markdown from 'react-native-markdown-display';
import React from 'react'
import { StyleSheet, View } from 'react-native'
import { Card, List, Text } from '@ui-kitten/components'
import Markdown from 'react-native-markdown-display'
import { Image } from 'react-native-svg'
export const NewsList = ({news: data}) => {
export const NewsList = ({news}) => {
const renderItemHeader = (headerProps, info) => (
<View {...headerProps} style={styles.header}>
@ -12,13 +13,13 @@ export const NewsList = ({news: data}) => {
{info.item.header}
</Text>
</View>
);
)
const renderItemFooter = (footerProps, info) => (
<Text {...footerProps}>
Publicerad i Skolplattformen
</Text>
);
)
const renderItem = (info) => (
<Card
@ -26,30 +27,26 @@ export const NewsList = ({news: data}) => {
status='basic'
header={headerProps => renderItemHeader(headerProps, info)}
footer={footerProps => renderItemFooter(footerProps, info)}>
<Markdown style={{
body: {color: 'white', fontSize: 15},
heading1: {color: 'white'},
}}>
<Markdown style={{ body: {color: 'black', fontSize: 15}, heading1: {color: 'black'} }}>
{decodeURIComponent(info.item.body)}
</Markdown>
</Card>
);
)
return (
<List
style={styles.container}
contentContainerStyle={styles.contentContainer}
data={data}
renderItem={renderItem}
/>
);
};
data={news}
renderItem={renderItem} />
)
}
const styles = StyleSheet.create({
header:{
header: {
backgroundColor: '#fff',
minHeight: 30,
padding: 3
padding: 25
},
headerText: {
color: '#000'
@ -58,12 +55,12 @@ const styles = StyleSheet.create({
maxHeight: '100%'
},
contentContainer: {
paddingVertical: 4,
paddingVertical: 4
},
item: {
marginVertical: 4,
marginVertical: 4
},
footer: {
backgroundColor: '#000',
backgroundColor: '#000'
}
});
})

View File

@ -2,14 +2,14 @@ import React from 'react';
import { NavigationContainer } from '@react-navigation/native';
import { createMaterialTopTabNavigator } from '@react-navigation/material-top-tabs';
import { TabBar, Tab, Layout, Text } from '@ui-kitten/components';
import { NewsList } from './newsList.component';
import { ChildList } from './childList.component';
import { DetailsScreen } from './details.component';
const { Navigator, Screen } = createMaterialTopTabNavigator();
const NewsScreen = ({child}) => (
const ChildScreen = ({data}) => (
<Layout style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
<Text category='h1'>Nyheter</Text>
<NewsList news={child.news}></NewsList>
</Layout>
);
@ -22,15 +22,15 @@ const TopTabBar = ({ navigation, state }) => (
</TabBar>
);
const TabNavigator = () => (
const TabNavigator = ({children}) => (
<Navigator tabBar={props => <TopTabBar {...props} />}>
<Screen name='News' component={NewsScreen}/>
<Screen name='Class' component={ClassScreen}/>
<Screen name='Child' component={ChildScreen} data={children}/>
<Screen name='Class' component={DetailsScreen}/>
</Navigator>
);
export const AppNavigator = () => (
export const AppNavigator = ({children}) => (
<NavigationContainer>
<TabNavigator/>
<TabNavigator children={children }/>
</NavigationContainer>
);