Chip with react-router Link - react-mui

Chip gives possibility to generate a link using component="a" clickable href="/", but I can't find a way to generate it as a react-router <Link>. Any ideas?

Found a way, it needs to have both component and to parameters, not href
<Chip
key={tag.slug}
label={tag.translation}
component={Link}
to={"/tag/" + tag.slug}
clickable
/>

Related

Trouble using gatsby-image with material-ui CardMedia component

Material-ui's Card component can have a CardMedia component as a child that accepts image source as a prop. Gatsby-image on the other hand requires it's own source as a prop(fixed or fluid).
<Card>
<CardHeader title={title}/>
<CardMedia src={image.localFile.childImageSharp.fixed} component={Img} />
</Card>
Is there any workaround for this issue?
Both, <CardMedia> and <Img> are wrappers themselves. The first one accepts children as a prop (as shown in their documentation) and <Img> from Gatsby-image is a container with its own features (responsive sizes, lazy loading, etc), not an image itself.
You can easily fix it by wrapping the <Img> with the <CardMedia>:
<Card>
<CardHeader title={title}/>
<CardMedia>
<Img fixed={image.localFile.childImageSharp.fixed} />
</CardMedia>
</Card>
Gatsby image isn't here just for getting source of the image, it has its own features which requires that it has its own container.
On the other hand CardMedia is dedicated container for showing image from source.
To fix your issue simply mimic behaviour of CardMedia component. This is simple container just holding image anyway.

Jssor slider - adding hyperlinks

Does anyone know if it's possible for each slide in the slider control to link to a URL when clicked on?
The control has been great for me so far, but a customer has asked for the above and I can't see an obvious way of doing it.
Many thanks!
Please use following code to define a slide with link.
<div><a u="image" href="url"><img src="image.jpg" /></a></div>
Reference http://www.jssor.com/development/define-slides-html-code.html

How to display everyone of the label and the radio choices in its own line?

I'm using Struts2. By default, when using the struts form, the label and the choices are displayed in the same line. How can I do to make the label in a line, and every radio choice in its own line? Is there a way by CSS? I need your help guys. Here it is how my form looks like. Thank you!
<s:form action="resultAction" namespace="/">
<s:radio label="Gender" name="yourGender" list="genders" value="defaultGenderValue" />
<s:submit value="submit" name="submit" />
</s:form>
Which theme are you using as by default struts2 use xHtml theme and which generate certain set of Tables to render the view.
Struts2 use free-marker template to render the HTML for tags and you can customize theme as per your choice or can create you rown theme.
Try with simple theme which will not generate any table or div and will render plain HTML for you are you have all way to apply your custom CSS to change/customize the view.
You can set the theme per page basis on for the whole application for per page basis add the following line in the head section
<s:set name="theme" value="'simple'" scope="page" />
for whole application you can either set in struts.properties file or in struts.xml file though the second one is more preferable.
<constant name="struts.ui.theme" value="simple" />
If you want to play with theme here is the link for same
struts-2-themes

<embed> instead <img> tag HTML

I want to make a function that allows me to display an image or a swf, I noticed that the embed tag I can show both, I lnvestigated and got nothing about it, there is some downside in using it?
example:
<embed src="image.png" />
<embed src="flash.swf" />
Both work even without including the type.
You really should use the <img> tag for images and not <embed>. Instead, figure out what the file type is first and then use either <img> OR <embed> depending on the file type.
Yes, but, however, <embed> tag isn't recommended to be used.

Facebook share button anchor tag vs including javascript

What is different of having a facebook share button just by having an anchor tag:
<a href="http://www.facebook.com/sharer.php?u=<url to share>&t=<title of content>">
<img src="custom.jpg" />
</a>
than having one with the javascript provided by FB follow by the anchor tag?
<script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script>
I just want to verify I'm not missing any of the basic functionality of sharing a link by using the anchor tag only because I want to use the anchor tag way to customize my button image.
The end result of the share is the same, as when you click the button it ends up taking you to the same endpoint. The difference is in how the button looks (and the count that shows up if that's the layout you've chosen).