Skip to content

Commit

Permalink
Merge pull request #2 from tmurtazin/types-for-stories
Browse files Browse the repository at this point in the history
Types for stories
  • Loading branch information
galchenkov authored Nov 16, 2020
2 parents c359021 + 751a4f3 commit 19b3223
Showing 1 changed file with 54 additions and 0 deletions.
54 changes: 54 additions & 0 deletions src/Chatium/Types.php
Original file line number Diff line number Diff line change
Expand Up @@ -231,3 +231,57 @@ function Screen($props, array $blocks = [])

return $block;
}


/**
* @param $props
* @return array
* @throws Exception
*/
function FullScreenStory($props)
{
$block = [];

requiredField('FullScreenStory', 'id', $props);
$block['id'] = $props['id'];

if (isset($props['stories'])) $block['stories'] = $props['stories'];

return $block;
}

/**
* @param $props
* @return array
* @throws Exception
*/
function Story($props)
{
$block = [];

requiredField('Stories', 'id', $props);
$block['id'] = $props['id'];

if (isset($props['slides'])) $block['slides'] = $props['slides'];

return $block;
}

/**
* @param $props
* @return array
* @throws Exception
*/
function Slide($props)
{
$block = [];

requiredField('Slide', 'id', $props);
$block['id'] = $props['id'];

if (isset($props['stretchContent'])) $block['stretchContent'] = $props['stretchContent'];
if (isset($props['content'])) $block['content'] = $props['content'];
if (isset($props['overlay'])) $block['overlay'] = $props['overlay'];

return $block;
}

0 comments on commit 19b3223

Please sign in to comment.