Trying to set Montserrat font on all pages of my React-Native App - react-native

I'm trying to apply the Montserrat font to all elements in my react-native app but can't seem to do it.
I've downloaded all 18 of the ttf files and put them into my assets/fonts folder.
I then tried using react-native-global-props:
import { setCustomText } from 'react-native-global-props';
const customTextProps = {
style: {
fontFamily: 'Montserrat'
}
}
setCustomText(customTextProps);
This didn't do anything to the text components of my app.
I then tried using defaultProps:
Text.defaultProps.style = { fontFamily: 'Montserrat' }
Also had no effect.
I also followed all the steps in this medium post about using custom fonts:
https://medium.com/react-native-training/react-native-custom-fonts-ccc9aacf9e5e
My main aim is to apply Montserrat font to every element of my entire app. I have a feeling it might have something to do with the font-type itself as Google Fonts say to apply fonts using this:
font-family: 'Montserrat', sans-serif;
However, react-native doesn't like the sans-serif as it has a hiphon so I just excluded it instead.
Any advice on this would be much appreciated.

Related

how to disable ripple in nuxt js with vuetify?

I have created a NuxtJS project and selected Vuetify as the UI framework from default selections. I would like to disable the ripple effect on buttons and other possible vuetify components. Since there is no dedicated Vuetify.js file and all are configured in the nuxt.config.js file, I tried editing the same.
vuetify: {
button: {
disableRipple: true,
},
}
but no use. So, any help on this would be appreciated
After a long research, found out that, remove ripple effect on icon button accepted answer solved my case too. Answer maybe common but question is different 😅
In case if anything changes/for future reference,
.v-btn:before {
opacity: 0 !important;
}
.v-ripple__container {
opacity: 0 !important;
}
Thanks to Anant Vikram Singh

Does anyone have examples of Google Street View working on Squarespace using the API?

Does anyone have examples of Google Street View working on Squarespace using the API?
I have been able to use other examples to display google maps (non street view) but when I try to get Google's street view example to work... nothing.
Here is my attempt:
http://keweenaw.squarespace.com/googlemapsapitest
I have this code in my page header code injection
<style>
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#street-view {
height: 100%;
}
</style>
<script>
var panorama;
function initialize() {
panorama = new google.maps.StreetViewPanorama(
document.getElementById('street-view'),
{
position: {lat: 37.869260, lng: -122.254811},
pov: {heading: 165, pitch: 0},
zoom: 1
});
}
</script>
<script async defer
src="https://maps.googleapis.com/maps/api/js?key= AIzaSyBSlsYgCGP7KfS5doe_q0X9guiJ3WNrfns&callback=initialize">
</script>
And this in a code block on the page:
<div id="street-view""></div>
You've got a number of issues which, once corrected, do in fact generate a working embedded Google Street View on a test Squarespace account.
You have a space at the beginning of your API key, causing it to be invalid.
You have an extra set of double quotes on <div id="street-view""></div>
Your CSS rule `#street-view {height: 100%;} won't work. Briefly put, you'll have to define a height in pixels, like "400px" or a similar 'fixed' unit.
You are loading the API over HTTPS but your site is HTTP. You need to either enable SSL on your Squarespace site or change the API url to http://maps.googleapis.com/maps/...etc. The prior is likely preferred.
By opening your browser's console (F12) you can see the specific error messages and work through them one by one (although, having seen these before certainly makes diagnosis faster).
To get you back on the right track, I would put the following code entirely in a code block on the page, where you want the map to appear. You can adjust width and height via your CSS. Once you get it working, you can experiment (if you choose) with moving your CSS to the CSS Editor and your Javascript to Code Injection.
<div id="street-view"></div>
<style>
#street-view {
height: 400px;
width: 100%;
}
</style>
<script>
var panorama;
function initialize() {
panorama = new google.maps.StreetViewPanorama(
document.getElementById('street-view'),
{
position: {lat: 37.869260, lng: -122.254811},
pov: {heading: 165, pitch: 0},
zoom: 1
}
);
}
</script>
<script async defer src="http://maps.googleapis.com/maps/api/js?key=AIzaSyBSlsYgCGP7KfS5doe_q0X9guiJ3WNrfns&callback=initialize"></script>
Also, note that the code above is using HTTP for the Maps API so that it will work with your current configuration. If you choose to enable SSL as mentioned, you'll need to change the Maps API url to HTTPS.
Here is a working example, using HTTPS. This example will quit working soon.

How to remove "deprecation" in Atom IDE?

Does anyone know how to remove the annoying "deprecations" word in the right bottom corner from Atom IDE?.
You can easily remove it. File => Settings => Packages => Core Packages => Deprecation Cop => Disable
I've seen where the deprecated call is part of Atom itself:
It could also be due to an incompatible package but troubleshooting those becomes an endless chore. Thankfully it's possible to edit the css:
Atom->Stylesheet... (styles.less)
Before:
I found that changing the text color from orange to default was enough for me:
.deprecation-cop-status {
color: inherit;
}
You can also hide it completely (use visibility: hidden; to preserve width if desired):
.deprecation-cop-status {
display: none;
}
Just click on the deprecation word, and it should open a new tab telling you what's wrong. Update or delete the package that causes the deprecations and the word will be removed.

Ember view to display a PDF

In one of my views I would like to display a PDF, which is accesible via URL. This should be done without opening an extra tab in the browser, and without downloading the PDF (to view it outside the browser). It should be visible embedded within the Ember application.
What I have in mind is:
Use the URL to get the PDF and make it accessible to the ember application.
Use a special "PDF view" to display the PDF.
Is this possible? What options do I have to display an embedded PDF in an Ember application?
Displaying a PDF is not really related to ember, because to view a PDF you need a PDF plugin installed in your browser (which is mostly installed by default depending by the browser).
That said, a possible solution I could imagine could be to create a custom ember view with the tagName iframe on which you set the src attribute to the link referring to the PDF.
Example:
App.PDFView = Ember.View.extend({
tagName: 'iframe',
attributeBindings: ['src', 'width', 'height', 'frameborder'],
src: 'pdffile.pdf',
width: 800,
height: 600,
frameborder: 0
});
I've also used width, height and frameborder only for convenience so you can control some of the iframe's attributes easily from within ember. Here a working demo.
You can also go with something more elaborated and use a js lib like http://pdfobject.com/ which you then initialize in your view's didInsertElement hook:
App.PDFView = Ember.View.extend({
src: 'pdffile.pdf',
width: 800,
height: 600,
didInsertElement: function() {
new PDFObject({
url: this.get('src'),
width: this.get('width'),
height: this.get('height')}
).embed(this.get('elementId'));
}
});
(haven't tested the latter, but you get the point)
And then use this App.PDFView like a normal ember view in your templates.
{{view App.PDFView}}
Or your can set the src, width & height directly from within your template like
{{view App.PDFView src="pdffile.pdf" width="600" height="800"}}
Hope it helps.
You can certainly leverage the Ember PDFJS Addon by doing:
ember install ember-pdfjs
The README on GitHub describes the installation and use cases.
In short, the addon provides your Ember project with a component, pdf-document, which you can use in your HTMLBars template like so:
{{pdf-document src=[model.src]}}
... there are other permutations of what src can be (including a string file path, resource URI, or Uint8Array buffer).
If you don't see a feature that you need, please suggest in the Issues.

How to use additional icons in Sencha Touch tabBar?

With Sencha Touch, i want to use some of the icons in the directory resources/themes/images/default/pictos/ for iconCls in my footer navigation. But from what I've read, it says I need to set up a ruby on rails server just to compile the right stylesheets and javascript files to use them?
I don't have the least bit knowledge of how to set up my own servers or set up my own RoR server. Is there anyway else to do this? I just want 3 icons from that directory...setting up a whole server seems a bit overkill.
Yes, you need to install Ruby and RubyGems (only if you're on Windows because they are pre bundled on Mac)
Then you just need to open the right scss file in touch/resources/sass (depending on what them you're using) and to add the following line to it :
#include pictos-iconmask(PICTOS_NAME);
Finally you need to open a terminal in that folder and to execute the following command :
compass compile // Run it every time you change something in the .scss
or
compass watch // Will automatically recompile every time you save
More information about Sencha-Touch Theming here
I used the following CSS
/* TV icon for Videos */
/* USED IN SENCHA TOUCH V2*/
.x-tab .x-button-icon.tv,.x-button .x-button-icon.x-icon-mask.tv{-webkit-mask-image:url(/resources/themes/images/default/pictos/TV.png)}
Actually... to be perfectly honest, I didn't map my CSS to the image, but rather converted the image to Base64 and embedded it in the CSS. The reason for this was that I only needed 4 of the icons and I didn't want to move them all around every time.
/* TV icon for Videos */
/* USED IN SENCHA TOUCH V2*/
.x-tab .x-button-icon.tv,.x-button .x-button-icon.x-icon-mask.tv{-webkit-mask-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAFmUlEQVRoBe2aX6hURRzH75p/qCjLMLKk7CoZEgmikHjLSxbqWz30B6SXzF6ieujPg0FFfzB66KUSfO4hJAqKKDSp25USi6hESCoKUyr6Z4lalnn7fJadbTxnz+7Zc3fv3T34gw8zZ87Mb+Y7c87MnNmtjI2NDbRrlUplJmVugfNhKxzAT/uOKJjXqLNC3rlwOxyCV6nSsD2zne1CDY/A76DIj2AIzmjXT978+q7VMUponYfhybzl43xTKFjE5lNoeq3gMsLNsJRBKOqv5iod1HwurtVxbS3HVMKL07lzpMTq88ZxuwI+hRNgj8t+WAfT8vpplU9f4CP8DYR6rNO6V7Qq3+h+249zcEKFy2EX/AuhMb8S3wAzQr6ioT7ADtRn8H+S+GewvLDfogUthw3CCMQjfZTrTTCrqG/KOhnq4wgEsdYxAvOL+q22eTyFq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pwc37p//vnh7h/h/D5grKMksfQ+YO8GdZ12G3lf4XNLW9LINgd1r+sL4J/J+IS9RV4PdwKQWjq/oz7FG2lYofY7fl8a2krEyTliPb0sokuKVYM5RJcOpsulEPZAnOVbiRw0lKU0dyAm74iCczhfZ66pfVGSHPZISeVyUHQ2GzYT2T1SuEYZa+lHjKsgRfRk4PsT0u6RVTiMeyjdp8Dun31CDItqxRvI0ii+ixrPvZHrt3x5PIDaC4wtaot3Tmov0ivIRo/zDmSDd8J0jvtlnvIKyHZeBOqrBlCdahP2O4Y2m4gJthAk3RzdqauymtnNib4+rR3C2ZoIy+oz6uvfjjd6e7QI3HFTwK/sex7HYAgTt8XL8FBftl4Ulfq8ecLH1lfjq+B0/Atv8AOeLFDQ1OlmYAAAAASUVORK5CYII=);}
Now, when you're creating your TabPanel you want do do something along these lines.
Ext.create('Ext.TabPanel', {
fullscreen: true,
tabBar: {
docked: 'bottom',
layout: {
pack: 'center'
}
},
items: [{
title: 'Video',
iconCls: 'tv' // the icon class string is appended to the CSS
// '.x-icon-mask.[iconCls string]'
// in this case
// '.x-icon-mask.tv'
// as seen in the CSS above
}]
});
EDIT
Looking over my old Sencha Touch V1 code base (as per your comment below) you will want to use the following CSS for Sencha Touch V1
/* TV icon for Videos */
/* USED IN SENCHA TOUCH V1*/
.x-tab img.tv,.x-button img.x-icon-mask.tv{-webkit-mask-image:url('/resources/themes/images/default/pictos/TV.png');}