Skip to content

Commit

Permalink
new types for stories format
Browse files Browse the repository at this point in the history
  • Loading branch information
tmurtazin committed Nov 11, 2020
1 parent a5bd6b2 commit 751a4f3
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 751a4f3

Please sign in to comment.