Skip to content
This repository was archived by the owner on Apr 23, 2024. It is now read-only.

VKCOM/vk-apps-themes-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is this about?

This is a VK apps demo app that shows work with the color scheme on iOS.

import 'core-js/es6/map';
import 'core-js/es6/set';
import React from 'react';
import ReactDOM from 'react-dom';
import connect from '@vkontakte/vkui-connect';
import App from './App';

connect.subscribe((e) => {
   switch (e.detail.type) {
       case 'VKWebAppUpdateConfig':
           let schemeAttribute = document.createAttribute('scheme');
           schemeAttribute.value = e.detail.data.scheme ? e.detail.data.scheme : 'client_light';
           document.body.attributes.setNamedItem(schemeAttribute);
           break;

       default:
           console.log(e.detail.type);
   }
});

// Init VK App
connect.send('VKWebAppInit', {});

ReactDOM.render(<App />, document.getElementById('root'));

Live Demo

Dark Light

How to start

yarn start || npm start — this will start dev server with hot reload on localhost:10888.

yarn run build || npm run build — this will build production bundle, with treeshaking, uglify and all this modern fancy stuff

About

No description or website provided.

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors