Added basic styles and licence
This commit is contained in:
parent
c56f11e78a
commit
b37fe9644a
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,4 @@
|
||||
node_modules/
|
||||
build/
|
||||
*.tgz
|
||||
*.tgz
|
||||
.vscode/
|
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -1,3 +0,0 @@
|
||||
{
|
||||
"typescript.tsdk": "node_modules/typescript/lib"
|
||||
}
|
21
LICENCE
Normal file
21
LICENCE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2020 Dmitriy Shishkov
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
@ -43,7 +43,16 @@ const CalendarInContext: React.FC<ICalendarProps> = ({ eventList }) => {
|
||||
}, [context.state])
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div
|
||||
style={{
|
||||
height: '100%',
|
||||
width: '100%',
|
||||
display: 'grid',
|
||||
gridTemplateColumns: 'repeat(7, 1fr)',
|
||||
gridTemplateRows: 'repeat(5, 1fr)',
|
||||
gap: '5px'
|
||||
}}
|
||||
>
|
||||
{monthDaysState.map((day, dayIndex) => (
|
||||
<Day
|
||||
key={dayIndex}
|
||||
|
38
src/Day.tsx
38
src/Day.tsx
@ -4,13 +4,43 @@ import { IDayProps } from './types'
|
||||
|
||||
const Day: React.FC<IDayProps> = ({ dayNumber, events, shaded }) => {
|
||||
return (
|
||||
<div style={shaded ? { background: '#EEEEEE' } : {}}>
|
||||
<h6>{dayNumber}</h6>
|
||||
<ul>
|
||||
<div
|
||||
style={{
|
||||
background: '#EEEEEE',
|
||||
borderRadius: '5px',
|
||||
maxHeight: '100px',
|
||||
overflow: 'hidden',
|
||||
padding: '5px',
|
||||
position: 'relative',
|
||||
opacity: shaded ? '0.5' : '1',
|
||||
}}
|
||||
>
|
||||
<h5
|
||||
style={{
|
||||
textAlign: 'center',
|
||||
margin: '0px',
|
||||
}}
|
||||
>
|
||||
{dayNumber}
|
||||
</h5>
|
||||
<ul style={{ paddingLeft: '20px', margin: '0' }}>
|
||||
{events.map((event, key) => (
|
||||
<li key={key}>{event.title}</li>
|
||||
<li key={key} style={{}}>
|
||||
{event.title}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
<div
|
||||
style={{
|
||||
position: 'absolute',
|
||||
bottom: '0px',
|
||||
marginLeft: '-5px',
|
||||
width: '100%',
|
||||
height: '50%',
|
||||
display: 'block',
|
||||
backgroundImage: 'linear-gradient(transparent, #EEEEEE)',
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user